Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

region-info: incorrect endpoint for s3-static-site in eu-west-1 #4573

Closed
eudes opened this issue Oct 17, 2019 · 1 comment · Fixed by #4584
Closed

region-info: incorrect endpoint for s3-static-site in eu-west-1 #4573

eudes opened this issue Oct 17, 2019 · 1 comment · Fixed by #4584
Assignees
Labels
@aws-cdk/region-info Related to AWS Region information bug This issue is a bug. in-progress This issue is being actively worked on.

Comments

@eudes
Copy link

eudes commented Oct 17, 2019

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/core@1.13.1
  • 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 Report

@eudes eudes added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2019
@SomayaB SomayaB added the @aws-cdk/aws-s3 Related to Amazon S3 label Oct 17, 2019
@SomayaB SomayaB added @aws-cdk/region-info Related to AWS Region information and removed @aws-cdk/aws-s3 Related to Amazon S3 labels Oct 17, 2019
@SomayaB SomayaB assigned RomainMuller and unassigned eladb Oct 17, 2019
@SomayaB SomayaB added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2019
@nmussy
Copy link
Contributor

nmussy commented Oct 18, 2019

Hey @eudes,

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

const AWS_OLDER_REGIONS = new Set([
'us-east-1',
'us-west-1',
'us-west-2',
'ap-southeast-1',
'ap-southeast-2',
'ap-northeast-1',
'sa-east-1'
]);

I'll make a quick PR to fix it 👍

@SomayaB SomayaB added in-progress This issue is being actively worked on. and removed needs-reproduction This issue needs reproduction. labels Oct 18, 2019
@mergify mergify bot closed this as completed in #4584 Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/region-info Related to AWS Region information bug This issue is a bug. in-progress This issue is being actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants