(cloudfront): Migration from CloudFrontWebDistribution to WebDistribution
See original GitHub issueGeneral Issue
General Issue
The Question
I had the following code for CloudFrontWebDistribution
const webDistribution = new cloudfront.CloudFrontWebDistribution(this, 'MyCfnDistribution', {
// ...
});
Converted it to support the Distribution Class
const webDistribution =new cloudfront.Distribution(this, 'MyCfnDistribution', {
// ...
});
const distributionCfn = webDistribution.node.defaultChild as cloudfront.CfnDistribution;
distributionCfn.overrideLogicalId('LogicalId')
When I deployed this new code I got the following error:
Invalid request provided: The parameter globPattern is too small or empty. (Service: CloudFront, Status
Code: 400
How Do I Solve this? Are there Any Other ways to Migrate to Distribution Construct?
CDK CLI Version
1.126.0
Framework Version
No response
Node.js Version
No response
OS
Windows
Language
Typescript
Language Version
No response
Other information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
cloudfront: How to migrate CloudFrontWebDistribution to the ...
I converted this into the new Distribution class. new cloudfront. ... cloudfront: How to migrate CloudFrontWebDistribution to the new ...
Read more >Routing traffic to an Amazon CloudFront distribution by using ...
Routing traffic to an Amazon CloudFront distribution by using your domain name · You can route traffic to a CloudFront distribution only for...
Read more >Migrate a CDK managed CloudFormation distribution from the ...
I have an existing CDK setup in which a CloudFormation distribution is configured using the deprecated CloudFrontWebDistribution API, now I need ...
Read more >AWS::CloudFront::Distribution DistributionConfig - 亚马逊云科技
CloudFront supports HTTP/3 connection migration to allow the viewer to switch networks without losing connection. For more information about connection ...
Read more >Web Distributions - Working with Amazon CloudFront Course
Now that we are familiar with the environment within which we will create our CloudFront web distribution, from the AWS Management Console select...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There doesn’t seem to be a direct way to not include the pathPattern, but you can override the CDK output for pathpattern on the additional behaviors with an escape hatch!
distributionCfn.addPropertyDeletionOverride('DistributionConfig.CacheBehaviors.0.PathPattern')
This will remove the
PathPattern
from your template for the first additional behavior you add. Simply change the number0
to change which behavior you’re modifying in the templateHey @DarshanAwachat, sorry I missed this
I’m not entirely sure what you’re asking here, but you shouldn’t run into any issues down the line just for overriding a logical ID. That should be stable 🙂