@@ -55,6 +55,33 @@ async function main(): Promise<void> {
55
55
'sa-east-1' ,
56
56
] ) ;
57
57
58
+ /**
59
+ * The hosted zone Id if using an alias record in Route53.
60
+ *
61
+ * @see https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_website_region_endpoints
62
+ */
63
+ const ROUTE_53_BUCKET_WEBSITE_ZONE_IDS : { [ region : string ] : string } = {
64
+ 'us-east-2' : 'Z2O1EMRO9K5GLX' ,
65
+ 'us-east-1' : 'Z3AQBSTGFYJSTF' ,
66
+ 'us-west-1' : 'Z2F56UZL2M1ACD' ,
67
+ 'us-west-2' : 'Z3BJ6K6RIION7M' ,
68
+ 'ap-east-1' : 'ZNB98KWMFR0R6' ,
69
+ 'ap-south-1' : 'Z11RGJOFQNVJUP' ,
70
+ 'ap-northeast-3' : 'Z2YQB5RD63NC85' ,
71
+ 'ap-northeast-2' : 'Z3W03O7B5YMIYP' ,
72
+ 'ap-southeast-1' : 'Z3O0J2DXBE1FTB' ,
73
+ 'ap-southeast-2' : 'Z1WCIGYICN2BYD' ,
74
+ 'ap-northeast-1' : 'Z2M4EHUR26P7ZW' ,
75
+ 'ca-central-1' : 'Z1QDHH18159H29' ,
76
+ 'eu-central-1' : 'Z21DNDUVLTQW6Q' ,
77
+ 'eu-west-1' : 'Z1BKCTXD74EZPE' ,
78
+ 'eu-west-2' : 'Z3GKZC51ZF0DB4' ,
79
+ 'eu-west-3' : 'Z3R1K369G5AVDG' ,
80
+ 'eu-north-1' : 'Z3BAZG2TWCNX0D' ,
81
+ 'sa-east-1' : 'Z7KQH4QJS55SO' ,
82
+ 'me-south-1' : 'Z1MPMWCPA7YB62' ,
83
+ } ;
84
+
58
85
for ( const region of AWS_REGIONS ) {
59
86
const partition = region . startsWith ( 'cn-' ) ? 'aws-cn' : 'aws' ;
60
87
registerFact ( region , 'PARTITION' , partition ) ;
@@ -65,8 +92,10 @@ async function main(): Promise<void> {
65
92
registerFact ( region , 'CDK_METADATA_RESOURCE_AVAILABLE' , AWS_CDK_METADATA . has ( region ) ? 'YES' : 'NO' ) ;
66
93
67
94
registerFact ( region , 'S3_STATIC_WEBSITE_ENDPOINT' , AWS_OLDER_REGIONS . has ( region )
68
- ? `s3-website-${ region } .${ domainSuffix } `
69
- : `s3-website.${ region } .${ domainSuffix } ` ) ;
95
+ ? `s3-website-${ region } .${ domainSuffix } `
96
+ : `s3-website.${ region } .${ domainSuffix } ` ) ;
97
+
98
+ registerFact ( region , 'S3_STATIC_WEBSITE_ZONE_53_HOSTED_ZONE_ID' , ROUTE_53_BUCKET_WEBSITE_ZONE_IDS [ region ] || '' ) ;
70
99
71
100
for ( const service of AWS_SERVICES ) {
72
101
registerFact ( region , [ 'servicePrincipal' , service ] , Default . servicePrincipal ( service , region , domainSuffix ) ) ;
0 commit comments