-
Notifications
You must be signed in to change notification settings - Fork 19
/
custom-domain-edge.yaml
60 lines (52 loc) · 1.25 KB
/
custom-domain-edge.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
AWSTemplateFormatVersion: 2010-09-09
Parameters:
HostedZoneId:
Type: AWS::Route53::HostedZone::Id
Description: The ID of the hosted zone to which the resource record should be added
Domain:
Type: String
Description: The Domain name for the API
Resources:
DomainName:
Type: AWS::ApiGateway::DomainName
Properties:
CertificateArn:
Ref: Certificate
DomainName:
Ref: Domain
EndpointConfiguration:
Types:
- EDGE
SecurityPolicy: TLS_1_2
Certificate:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName:
Ref: Domain
ValidationMethod: DNS
DomainValidationOptions:
- DomainName:
Ref: Domain
HostedZoneId:
Ref: HostedZoneId
RecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId:
Ref: HostedZoneId
Name:
Ref: Domain
Type: A
AliasTarget:
HostedZoneId:
Fn::GetAtt: DomainName.DistributionHostedZoneId
DNSName:
Fn::GetAtt: DomainName.DistributionDomainName
Outputs:
DomainName:
Description: The Domain name
Value:
Ref: Domain
Export:
Name:
Fn::Sub: ${AWS::StackName}-DomainName