Aws-cdk: region-info: incorrect endpoint for s3-static-site in eu-west-1

Created on 17 Oct 2019  路  1Comment  路  Source: aws/aws-cdk


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

Reproduction Steps


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)),
    });

Error Log


Tried to create an alias that targets s3-website.eu-west-1.amazonaws.com., type A in zone , but the alias target name does not lie within the target zone.

Environment

  • CLI Version : 1.13.1 (build 96cfc63)
  • Framework Version: @aws-cdk/[email protected]
  • OS : Arch Linux
  • Language : Typescript

Other


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

@aws-cdregion-info bug in-progress

Most helpful comment

Hey @eudes,

Thanks for the report. It looks like eu-west-1 is the only one missing from the AWS_OLDER_REGIONS list:

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 馃憤

>All comments

Hey @eudes,

Thanks for the report. It looks like eu-west-1 is the only one missing from the AWS_OLDER_REGIONS list:

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 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abelmokadem picture abelmokadem  路  3Comments

kawamoto picture kawamoto  路  3Comments

artyom-melnikov picture artyom-melnikov  路  3Comments

v-do picture v-do  路  3Comments

PaulMaddox picture PaulMaddox  路  3Comments