forked from org-formation/org-formation-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wildcard-certs.yml
79 lines (66 loc) · 2.48 KB
/
wildcard-certs.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
AWSTemplateFormatVersion: '2010-09-09-OC'
Organization: !Include ../organization.yml
OrganizationBindings:
# binding for LocalCert1, LocalCert1ArnParam, LocalUsEastCert1ArnParam
CertificateBinding:
Region:
- eu-central-1
- eu-west-1
AccountsWithTag: subdomain
# binding for UsEastCert1, UsEastCert1ArnParam
CertificateBindingUsEast:
Region: us-east-1
AccountsWithTag: subdomain
Parameters:
resourcePrefix:
Type: String
rootHostedZoneName:
Type: String
Resources:
LocalCert1:
Type: AWS::CertificateManager::Certificate
OrganizationBinding: !Ref CertificateBinding
Properties:
DomainName: !Sub '*.${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
SubjectAlternativeNames:
- !Sub '${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
ValidationMethod: EMAIL
DomainValidationOptions:
- DomainName: !Sub '${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
ValidationDomain: !Ref rootHostedZoneName
- DomainName: !Sub '*.${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
ValidationDomain: !Ref rootHostedZoneName
LocalCert1ArnParam:
Type: AWS::SSM::Parameter
OrganizationBinding: !Ref CertificateBinding
Properties:
Name: !Sub '${resourcePrefix}-certs-wildcard-cert1-arn'
Type: String
Value: !Ref LocalCert1
UsEastCert1:
Type: AWS::CertificateManager::Certificate
OrganizationBinding: !Ref CertificateBindingUsEast
Properties:
DomainName: !Sub '*.${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
SubjectAlternativeNames:
- !Sub '${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
ValidationMethod: EMAIL
DomainValidationOptions:
- DomainName: !Sub '${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
ValidationDomain: !Ref rootHostedZoneName
- DomainName: !Sub '*.${AWSAccount.Tags.subdomain}.${rootHostedZoneName}'
ValidationDomain: !Ref rootHostedZoneName
UsEastCert1ArnParam:
Type: AWS::SSM::Parameter
OrganizationBinding: !Ref CertificateBindingUsEast
Properties:
Name: !Sub '${resourcePrefix}-certs-wildcard-cert1-arn'
Type: String
Value: !GetAtt AWSAccount.Resources.UsEastCert1
LocalUsEastCert1ArnParam:
Type: AWS::SSM::Parameter
OrganizationBinding: !Ref CertificateBinding
Properties:
Name: !Sub '${resourcePrefix}-certs-us-east-1-wildcard-cert1-arn'
Type: String
Value: !GetAtt AWSAccount.Resources.UsEastCert1