The s3-static-site endpoint included in the region-info package for eu-west-1 is incorrect, making deployments fail when trying to target it in a DNS record.
Included:
s3-website.eu-west-1.amazonaws.com
Correct:
s3-website-eu-west-1.amazonaws.com
See: https://docs.aws.amazon.com/general/latest/gr/rande.html
Using region eu-west-1, configure a bucket and a custom DNS record (requires an already created hosted zone), and deploy:
const appBucket = new Bucket(this, 'AppBucket', {
bucketName: 'test.myhostedzone.com',
accessControl: BucketAccessControl.PUBLIC_READ,
websiteIndexDocument: 'index.html',
websiteErrorDocument: 'index.html',
});
appBucket.grantRead(new AnyPrincipal());
const dnsRecord = new RecordSet(this, 'DnsRecord', {
recordName: 'test.myhostedzone.com.',
recordType: RecordType.A,
zone: HostedZone.fromLookup(this, 'hostedZone', {
domainName: 'myhostedzone.com',
}),
target: RecordTarget.fromAlias(new BucketWebsiteTarget(bucket)),
});
Tried to create an alias that targets s3-website.eu-west-1.amazonaws.com., type A in zone
As a workaround, register the correct endpoint with the Facts object:
Fact.register({
region: 'eu-west-1',
name: FactName.S3_STATIC_WEBSITE_ENDPOINT,
value: 's3-website-eu-west-1.amazonaws.com',
}, true);
This is :bug: Bug Report
Hey @eudes,
Thanks for the report. It looks like eu-west-1 is the only one missing from the AWS_OLDER_REGIONS list:
I'll make a quick PR to fix it 馃憤
Most helpful comment
Hey @eudes,
Thanks for the report. It looks like
eu-west-1is the only one missing from theAWS_OLDER_REGIONSlist:https://github.com/aws/aws-cdk/blob/8a79cadd1aee1158e9375884174ac6c7c935834d/packages/%40aws-cdk/region-info/build-tools/generate-static-data.ts#L25-L33
I'll make a quick PR to fix it 馃憤