-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstackset.yaml
More file actions
57 lines (54 loc) · 1.96 KB
/
stackset.yaml
File metadata and controls
57 lines (54 loc) · 1.96 KB
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
AWSTemplateFormatVersion: 2010-09-09
Description: Provisions resources required for a static website
Parameters:
stacksetName:
Type: String
administratorAccountId:
Type: String
Description: The names of the AWS account to deploy stack set updates to
domain:
Type: String
Description: Purchased domain, will be used to create a S3 bucket with that name also
domainHostedZoneId:
# Required in order to create a SSL certificate, I don't think there is a way to dynamically look this up in CloudFormation
Type: String
Description: Hosted Zone ID for purchased domain
otherDomain:
Type: String
Description: I also bought a second domain, point it to the same CloudFront distribution
stacksetBucketName:
Type: String
Description: Name of the S3 bucket where CloudFormation template is stored. Will be read to create the website resources
websiteCfFile:
Type: String
Description: The name of the CloudFormation template file that will be read to provision the website resources
Resources:
sslCert:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: !Ref domain
DomainValidationOptions:
- DomainName: !Ref domain
HostedZoneId: !Ref domainHostedZoneId
SubjectAlternativeNames:
- !Ref otherDomain
ValidationMethod: DNS
websiteStackset:
Type: AWS::CloudFormation::StackSet
Properties:
Parameters:
- ParameterKey: domain
ParameterValue: !Ref domain
- ParameterKey: otherDomain
ParameterValue: !Ref otherDomain
- ParameterKey: sslCertArn
ParameterValue: !Ref sslCert
PermissionModel: SELF_MANAGED
StackInstancesGroup:
- DeploymentTargets:
Accounts:
- !Ref administratorAccountId
Regions:
- eu-west-3
StackSetName: !Ref stacksetName
TemplateURL: !Sub https://s3.eu-west-3.amazonaws.com/${stacksetBucketName}/${websiteCfFile}