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

[cloudfront] New Distribution object doesn't support escape hatches #9620

Closed
justin8 opened this issue Aug 12, 2020 · 1 comment · Fixed by #9648
Closed

[cloudfront] New Distribution object doesn't support escape hatches #9620

justin8 opened this issue Aug 12, 2020 · 1 comment · Fixed by #9648
Assignees
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@justin8
Copy link
Contributor

justin8 commented Aug 12, 2020

In trying to set a forwarded header value which I found wasn't supported (#9621) I attempted to use an escape hatch to override the property but received an error

Reproduction Steps

const bucket = new s3.Bucket(this, "bucket")
const dist = new cloudfront.Distribution(this, "dist", {
      defaultBehavior: {
        origin: new S3Origin(bucket),
    }});
const cfnDist = dist.node.defaultChild as cloudfront.CfnDistribution
cfnVodDistribution.addPropertyOverride("DistributionConfig.DefaultCacheBehavior.ForwardedValues.Headers", ["*"]);

What did you expect to happen?

I expected the ForwardedValues.Headers field to contain a list with a single "*" item in it.

What actually happened?

I received a Cannot read property 'addPropertyOverride' of undefined error

Environment

  • CLI Version : 1.57
  • Framework Version: 1.57
  • Node.js Version: 12.x
  • OS : MacOS
  • Language (Version): all

Other


This is 🐛 Bug Report

@justin8 justin8 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 12, 2020
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Aug 12, 2020
@njlynch njlynch assigned njlynch and unassigned iliapolo Aug 12, 2020
@njlynch njlynch added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 12, 2020
@njlynch
Copy link
Contributor

njlynch commented Aug 12, 2020

Thanks for the bug report, @justin8 .

This is a pretty quick fix; we'll take a look.

njlynch added a commit that referenced this issue Aug 12, 2020
Changed the ID for the CfnDistribution to support escape hatches
(`dist.node.defaultChild`).

fixes #9620

BREAKING CHANGE: (cloudfront) Changed IDs for Distributions
@mergify mergify bot closed this as completed in #9648 Aug 12, 2020
mergify bot pushed a commit that referenced this issue Aug 12, 2020
Changed the ID for the CfnDistribution to support escape hatches
(`dist.node.defaultChild`).

fixes #9620

BREAKING CHANGE: (cloudfront) Changed IDs for Distributions (will cause resource replacement).


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants