-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathdemo-stack.yaml
67 lines (60 loc) · 2.26 KB
/
demo-stack.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
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Demo Certificate DNS Record Provider
Parameters:
HostedZoneId:
Type: String
Default: 'Z0371259XDZLRTIQJZIY'
DomainName:
Type: String
Default: 'mark.binx.dev'
Resources:
Certificate:
Type: Custom::Certificate
Properties:
DomainName: !Ref DomainName
SubjectAlternativeNames:
- !Sub '*.${DomainName}'
ValidationMethod: DNS
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-certificate-provider'
IssuedCertificate:
Type: Custom::IssuedCertificate
DependsOn:
- DomainValidationRecord
Properties:
CertificateArn: !Ref Certificate
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-certificate-provider'
DomainNameValidationDNSRecord:
Type: Custom::CertificateDNSRecord
Properties:
CertificateArn: !Ref Certificate
DomainName: !Ref DomainName
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-certificate-provider'
AlternativeDomainNameValidationDNSRecord:
Type: Custom::CertificateDNSRecord
Properties:
CertificateArn: !Ref Certificate
DomainName: !Sub '*.${DomainName}'
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-certificate-provider'
DomainValidationRecord:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: !Ref HostedZoneId
RecordSets:
- Name: !GetAtt DomainNameValidationDNSRecord.Name
Type: !GetAtt DomainNameValidationDNSRecord.Type
TTL: 60
Weight: 1
SetIdentifier: !Ref Certificate
ResourceRecords:
- !GetAtt DomainNameValidationDNSRecord.Value
- Name: !GetAtt AlternativeDomainNameValidationDNSRecord.Name
Type: !GetAtt AlternativeDomainNameValidationDNSRecord.Type
TTL: 60
Weight: 1
SetIdentifier: !Ref Certificate
ResourceRecords:
- !GetAtt AlternativeDomainNameValidationDNSRecord.Value
Outputs:
DomainNameValidationDNSRecord:
Value: !Sub '${DomainNameValidationDNSRecord.Name} ${DomainNameValidationDNSRecord.Type} ${DomainNameValidationDNSRecord.Value}'