forked from amplify-education/serverless-domain-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DomainInfo.ts
29 lines (25 loc) · 1.06 KB
/
DomainInfo.ts
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
/**
* Wrapper class for Custom Domain information
*/
class DomainInfo {
public domainName: string;
public hostedZoneId: string;
public securityPolicy: string;
/**
* Sometimes, the getDomainName call doesn't return either a distributionHostedZoneId or a regionalHostedZoneId.
* AFAICT, this only happens with edge-optimized endpoints.
* The hostedZoneId for these endpoints is always the one below.
* Docs: https://docs.aws.amazon.com/general/latest/gr/rande.html#apigateway_region
* PR: https://github.com/amplify-education/serverless-domain-manager/pull/171
*/
private defaultHostedZoneId: string = "Z2FDTNDATAQYW2";
private defaultSecurityPolicy: string = "TLS_1_2";
constructor(data: any) {
this.domainName = data.distributionDomainName || data.regionalDomainName;
this.hostedZoneId = data.distributionHostedZoneId ||
data.regionalHostedZoneId ||
this.defaultHostedZoneId;
this.securityPolicy = data.securityPolicy || this.defaultSecurityPolicy;
}
}
export = DomainInfo;