-
Notifications
You must be signed in to change notification settings - Fork 19
/
aws-shibboleth-idp-withvpc.yaml
323 lines (289 loc) · 10.7 KB
/
aws-shibboleth-idp-withvpc.yaml
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
This template utilizes AWS CodePipeline and AWS CodeBuild to build an
automated continuous deployment pipeline to Amazon Elastic Container Service
(Amazon ECS) using clusters powered by AWS Fargate or Amazon Elastic Compute
Cloud (Amazon EC2). The container that is deployed is the Shibboleth IdP
reference architecture.
An Application Load Balancer is also provisioned as a front end service
endpoint. HTTPS is enabled so you must also populate the CertificateARN
parameter with the ARN of the certificate that you wish to use on the load balancer.
Use this template if you would like to provision a new VPC with your deployment.
If you would like to use an existing VPC with this stack, please use the template
aws-shibboleth-idp-vpc.yaml
Parameters:
ShibbolethVersionTag:
Type: String
Default: latest
Description: >
The tag to use for the base tier/shib-idp docker image. Common options would be 'latest', 'latest5', or 'latest4'. Any valid tag from https://hub.docker.com/r/tier/shib-idp/tags should be valid.
LaunchType:
Type: String
Default: Fargate
AllowedValues:
- Fargate
- EC2
Description: >
The launch type for your service. Selecting EC2 will create an Auto
Scaling group of t2.micro instances for your cluster. See
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html
to learn more about launch types.
TemplateBucket:
Type: String
Default: aws-shibboleth-reference-architecture
Description: >
The S3 bucket from which to fetch the templates used by this stack.
We recommend that you store your CloudFormation templates in your own S3 bucket
instead of using the one provided with this reference architecture.
TemplateFolder:
Type: String
Default: ''
Description: >
The optional path to a folder in the TemplateBucket that concaints the CloudFormation templates. If not left blank, it must end with a '/'.
CodeCommitRepoName:
Description: >
Name of the CodeCommit repository to create. Please verify Pattern and maxlength
Type: String
Default: 'shibboleth'
MaxLength: 100
AllowedPattern: '(^[A-Za-z0-9_\.-]+)'
ConstraintDescription: >
Must conform with the permitted CodeCommit repository name pattern.
SealerKeyVersionCount:
Type: Number
Default: 10
Description: The number of versions of the sealear key to support
ParentDomain:
Type: String
Description: The base domain for the IdP such as 'example.com'
FullyQualifiedDomainName:
Type: String
Description: The fully qualified domain name for the IdP such as 'sso.example.com'
CertificateARN:
Type: String
Default: ''
Description: >
Specify the ARN of the SSL certificate to be used on HTTPS listener
VpcCIDR:
Type: String
Default: '10.215.0.0/16'
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Description: >
CIDR block of the VPC that will be created
PublicSubnet1CIDR:
Type: String
Default: '10.215.1.0/24'
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Description: >
CIDR block of public subnet 1
PublicSubnet2CIDR:
Type: String
Default: '10.215.2.0/24'
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Description: >
CIDR block of public subnet 2
PrivateSubnet1CIDR:
Type: String
Default: '10.215.11.0/24'
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Description: >
CIDR block of private subnet 1
PrivateSubnet2CIDR:
Type: String
Default: '10.215.12.0/24'
AllowedPattern: '((\d{1,3})\.){3}\d{1,3}/\d{1,2}'
Description: >
CIDR block of private subnet 2
LDAPUrl:
Type: String
Default: ldaps://ad-ldap.example.com:636
Description: >
The URL of the LDAP server.
LDAPBaseDN:
Type: String
Default: CN=Users,DC=example,DC=org
Description: >
The base DN of the LDAP server.
LDAPReadOnlyUser:
Type: String
Default: [email protected]
Description: >
The username of a read-only user for connecting to the LDAP server.
LDAPReadOnlyPassword:
Type: String
NoEcho: true
Default: EnterYourPasswordHere
Description: >
The password of a read-only user for connecting to the LDAP server.
Metadata:
AWS::CloudFormation::Interface:
ParameterLabels:
LaunchType:
default: "Launch Type"
CodeCommitRepoName:
default: "CodeCommit Repository Name"
TemplateBucket:
default: "Template Bucket"
TemplateFolder:
default: "Template Folder"
ParentDomain:
default: "Base Domain"
FullyQualifiedDomainName:
default: "Fully Qualified Domain Name"
CertificateARN:
default: "Certificate ARN for HTTPS Listener"
SealerKeyVersionCount:
default: "Sealer Key Version Count"
LDAPUrl:
default: "LDAP server URL"
LDAPBaseDN:
default: "LDAP base DN"
LDAPReadOnlyUser:
default: "LDAP user"
LDAPReadOnlyPassword:
default: "LDAP password"
ParameterGroups:
- Label:
default: IdP Domain Information
Parameters:
- ParentDomain
- FullyQualifiedDomainName
- Label:
default: ECS Cluster Configuration
Parameters:
- LaunchType
- Label:
default: CloudFormation Stack Configuration
Parameters:
- TemplateBucket
- TemplateFolder
- Label:
default: CodeCommit Configuration
Parameters:
- CodeCommitRepoName
- Label:
default: Elastic Load Balancer Configuration
Parameters:
- CertificateARN
- Label:
default: Shibboleth Configuration
Parameters:
- ShibbolethVersionTag
- SealerKeyVersionCount
- Label:
default: VPC Settings
Parameters:
- VpcCIDR
- PublicSubnet1CIDR
- PublicSubnet2CIDR
- PrivateSubnet1CIDR
- PrivateSubnet2CIDR
- Label:
default: LDAP Settings
Parameters:
- LDAPUrl
- LDAPBaseDN
- LDAPReadOnlyUser
- LDAPReadOnlyPassword
Resources:
Secrets:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/secrets.yml"
Parameters:
Name: !Ref AWS::StackName
LambdaBucket: !Ref TemplateBucket
LambdaFolder: !Ref TemplateFolder
SealerKeyVersionCount: !Ref SealerKeyVersionCount
LDAPUrl: !Ref LDAPUrl
LDAPBaseDN: !Ref LDAPBaseDN
LDAPReadOnlyUser: !Ref LDAPReadOnlyUser
LDAPReadOnlyPassword: !Ref LDAPReadOnlyPassword
SecurityGroups:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/security-groups.yml"
Parameters:
Name: !Ref AWS::StackName
LaunchType: !Ref LaunchType
VpcId: !GetAtt VPC.Outputs.VpcId
Cluster:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/ecs-cluster.yaml"
Parameters:
Name: !Ref AWS::StackName
LaunchType: !Ref LaunchType
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
VpcId: !GetAtt VPC.Outputs.VpcId
DeploymentPipeline:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/deployment-pipeline.yaml"
Parameters:
Name: !Ref AWS::StackName
Cluster: !GetAtt Cluster.Outputs.ClusterName
Service: !GetAtt Service.Outputs.Service
CodeCommitRepoName: !Ref CodeCommitRepoName
ParentDomain: !Ref ParentDomain
FullyQualifiedDomainName: !Ref FullyQualifiedDomainName
SecretsManagerSigningARN: !GetAtt Secrets.Outputs.SigningArn
SecretsManagerBackchannelARN: !GetAtt Secrets.Outputs.BackchannelArn
SecretsManagerEncryptionARN: !GetAtt Secrets.Outputs.EncryptionArn
SecretsManagerLDAPSettingsARN: !GetAtt Secrets.Outputs.LDAPSettingsArn
SecretsManagerSealerKeyARN: !GetAtt Secrets.Outputs.SealerKeyArn
RepoSourceBucket: !Ref TemplateBucket
RepoSourceFolder: !Ref TemplateFolder
TaskRoleARN: !GetAtt Service.Outputs.TaskRoleARN
TaskExecutionRoleARN: !GetAtt Service.Outputs.TaskExecutionRoleARN
LoadBalancer:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/load-balancer.yaml"
Parameters:
LaunchType: !Ref LaunchType
Subnets: !GetAtt VPC.Outputs.Subnets
VpcId: !GetAtt VPC.Outputs.VpcId
CreateHTTPSListener: true
CertificateARN: !Ref CertificateARN
LoadBalancerSecurityGroup: !GetAtt SecurityGroups.Outputs.LoadBalancerSecurityGroup
VPC:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/vpc.yaml"
Parameters:
Name: !Ref AWS::StackName
VpcCIDR: !Ref VpcCIDR
PublicSubnet1CIDR: !Ref PublicSubnet1CIDR
PublicSubnet2CIDR: !Ref PublicSubnet2CIDR
PrivateSubnet1CIDR: !Ref PrivateSubnet1CIDR
PrivateSubnet2CIDR: !Ref PrivateSubnet2CIDR
Service:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${TemplateBucket}.s3.amazonaws.com/${TemplateFolder}templates/service.yaml"
Parameters:
Name: !Ref AWS::StackName
Cluster: !GetAtt Cluster.Outputs.ClusterName
DesiredCount: 0
LaunchType: !Ref LaunchType
TargetGroup: !GetAtt LoadBalancer.Outputs.TargetGroup
SecurityGroup: !GetAtt SecurityGroups.Outputs.ECSSecurityGroup
Subnets: !GetAtt VPC.Outputs.PrivateSubnets
ContainerImageURI: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${CodeCommitRepoName}
SealerKeyArn: !GetAtt Secrets.Outputs.SealerKeyArn
Outputs:
LoadBalancerCanonicalHostedZoneID:
Description: The load balancer identifier
Value: !GetAtt LoadBalancer.Outputs.CanonicalHostedZoneID
LoadBalancerDNSName:
Description: Value to set your fully qualified domain names CNAME entry to in you DNS provider
Value: !GetAtt LoadBalancer.Outputs.DNSName
ServiceUrl:
Description: The URL of the IdP.
Value: !Sub https://${FullyQualifiedDomainName}/idp/
PipelineUrl:
Description: The continuous deployment pipeline in the AWS Management Console.
Value: !GetAtt DeploymentPipeline.Outputs.PipelineUrl