forked from aws-samples/account-factory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccountbaseline.yml
275 lines (245 loc) · 10.1 KB
/
Accountbaseline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# /*
# * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a copy of this
# * software and associated documentation files (the "Software"), to deal in the Software
# * without restriction, including without limitation the rights to use, copy, modify,
# * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# * permit persons to whom the Software is furnished to do so.
# *
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# */
AWSTemplateFormatVersion: 2010-09-09
Description: Baseline IAM resources for new account
Parameters:
AdminUsername:
Type: String
Description: Username for the Admin user
AdminPassword:
Type: String
NoEcho: true
MinLength: 1
Description: Password for the Admin user
NewRoleArn:
Type: String
Description: ARN of the NewRole
Resources:
Admin:
Type: 'AWS::IAM::User'
Properties:
UserName: !Ref AdminUsername
Path: /
LoginProfile:
Password: !Ref AdminPassword
Administrators:
Type: 'AWS::IAM::Group'
Properties:
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AdministratorAccess"
GroupName: Administrators
Path: /
AddUserToGroup:
Type: 'AWS::IAM::UserToGroupAddition'
Properties:
GroupName: !Ref Administrators
Users:
- !Ref Admin
EC2LinuxProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product builds one Amazon Linux EC2 instance and create a SSM patch baseline, maintenance window, and patch task to scan for and install operating system updates the EC2 instance."
Distributor: "Amazon"
Name: "Amazon Elastic Compute Cloud (EC2) Linux"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL : "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/ec2/sc-ec2-linux-ra.json"
EC2WindowsProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product builds one Amazon Windows EC2 instance and create a SSM patch baseline, maintenance window, and patch task to scan for and install operating system updates the EC2 instance."
Distributor: "Amazon"
Name: "Amazon Elastic Compute Cloud (EC2) Windows"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL : "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/ec2/sc-ec2-windows-ra.json"
VPCProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product builds one Amazon VPC with Public Subnets, Private Subnets, Route Tables, NAT Gateway and Internet Gateway"
Distributor: "Amazon"
Name: "Amazon VPC"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL : "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/vpc/sc-vpc-ra.json"
EMRProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "EMR product creates an Amazon Elastic MapReduce cluster in the VPC and Subnets selected by the end user. A remote access security group is also created to allow for a bastion host to connect to the instances used by EMR via SSH."
Distributor: "Amazon"
Name: "EMR Product"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL: "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/emr/sc-emr-ra.json"
RDSMySQLProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product allows the user to launch a RDS MySQL DB as either single instance databases or multi-availability zone databases."
Distributor: "Amazon"
Name: "RDS MySQL Product"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL: "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/rds/sc-rds-mssql-ra.json"
RDSMariaDBProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product allows the user to launch a RDS Maria DB as either single instance databases or multi-availability zone databases."
Distributor: "Amazon"
Name: RDS MariaDB Product
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL: "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/rds/sc-rds-mariadb-ra.json"
RDSPostGreSqlProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product allows the user to launch a RDS POSTGRE SQL as either single instance databases or multi-availability zone databases."
Distributor: "Amazon"
Name: "RDS POSTGRE SQL Product"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL: "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/rds/sc-rds-postgresql-ra.json"
S3BucketProduct:
Type: "AWS::ServiceCatalog::CloudFormationProduct"
Properties:
AcceptLanguage: "en"
Description: "This product allows the user to create an S3 Bucket locking down the access to a specific CIDR."
Distributor: "Amazon"
Name: "S3 Bucket Product"
Owner: "IT Services"
SupportEmail: "[email protected]"
SupportUrl: "https://www.amazon.com"
SupportDescription: "Support Description"
ProvisioningArtifactParameters:
-
Description: "June 2018"
Name: "June 2018"
Info:
LoadTemplateFromURL: "https://raw.githubusercontent.com/aws-samples/aws-service-catalog-reference-architectures/master/s3/sc-s3-cidr-ra.json"
BaselinePortfolio:
Type: "AWS::ServiceCatalog::Portfolio"
Properties:
DisplayName: "FirstPortfolio"
AcceptLanguage: "en"
ProviderName: "Amazon"
LinuxAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref EC2LinuxProduct
PortfolioId: !Ref BaselinePortfolio
WindowsAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref EC2WindowsProduct
PortfolioId: !Ref BaselinePortfolio
VPCAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref VPCProduct
PortfolioId: !Ref BaselinePortfolio
EMRAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref EMRProduct
PortfolioId: !Ref BaselinePortfolio
RDSMySQLAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref RDSMySQLProduct
PortfolioId: !Ref BaselinePortfolio
RDSMariaDBAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref RDSMariaDBProduct
PortfolioId: !Ref BaselinePortfolio
RDSPOSTGRESQLAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref RDSPostGreSqlProduct
PortfolioId: !Ref BaselinePortfolio
S3BucketAssociation:
Type: "AWS::ServiceCatalog::PortfolioProductAssociation"
Properties:
ProductId: !Ref S3BucketProduct
PortfolioId: !Ref BaselinePortfolio
PortfolioPrincipalAssociationforAdmin:
Type: "AWS::ServiceCatalog::PortfolioPrincipalAssociation"
Properties:
PrincipalARN: !GetAtt Admin.Arn
PortfolioId: !Ref BaselinePortfolio
PrincipalType: IAM
PortfolioPrincipalAssociationforRole:
Type: "AWS::ServiceCatalog::PortfolioPrincipalAssociation"
Properties:
PrincipalARN: !Ref NewRoleArn
PortfolioId: !Ref BaselinePortfolio
PrincipalType: IAM