(cloudfront): identifier not found
See original GitHub issueWe are using some Cloudfront Functions for our distributions but when we are deploying some changes our pipeline fails because it can not find the cloudfront based on its identifier. The problem is that the identifier that CDK Pipeline has is not correct.
Here’s the error :
Resource handler returned message: "Resource of type 'AWS::CloudFront::Function' with identifier 'eu-west-1mdscicdmdOfficeStaticSiteFunctionC23238D5' was not found." (RequestToken: 04588f89-6822-7f5d-22b2-c5c61f92ba7a, HandlerErrorCode: NotFound)
As you can see AWS CDK tries to find this identifier : eu-west-1mdscicdmdOfficeStaticSiteFunctionC23238D5
While the identifier found on the console is : eu-west-1mdscicdmdsOfficeStaticSiteFunctionC23238D5
Environment
- CDK CLI Version : 1.115.0
- Framework Version: 1.115.0
- Node.js Version: 14
- OS : Linux
- Language (Version): Typescript
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Troubleshooting distribution issues - Amazon CloudFront
Make sure that the URL that you're referencing uses the domain name (or CNAME) of your CloudFront distribution, not your Amazon S3 bucket...
Read more >How do I resolve the error "The request could not be satisfied ...
How do I resolve the error "The request could not be satisfied. Request Blocked" from CloudFront ?
Read more >aws_cloudfront_distribution | Resources | hashicorp/aws
The WAF Web ACL must exist in the WAF Global (CloudFront) region and the credentials configuring this argument must have waf:GetWebACL permissions assigned....
Read more >CloudFront distribution origin should be set to S3 or origin ...
Get the ID of the CloudFront CDN distribution you want to remediate, either via the console or CLI: · Save the distribution configuration...
Read more >Heroku SSL Cloudfront Missing Key-Pair-Id 403 error
This error occurs if you enable Restrict Viewer Access on the cache behavior on the distribution, but you are not actually using CloudFront...
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 FreeTop 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
Top GitHub Comments
Hello 👋
I am also affected by this issue. Here’s a minimal example of code that can be used to replicate the bug. This was tested with 1.118.0 and 1.117.0.
bin/cf-func-fail.ts
lib/cf-func-fail-stack.ts
lib/constructs/cf-func.ts
lib/cloudfront-functions/my_func.js
The bug is erratic. To replicate it, deploy the stack, modify the javascript function (changing the test2 string is sufficient), and redeploy. If the bug doesn’t occur, change the string again and deploy again (I use
npx cdk deploy
to deploy).It takes 2-3 tries, but you eventually get the following error:
There seems to be a mismatch between the resource name that CDK tries to update (
us-east-1CfFuncFailectionCloudFrontFunctionD10DE1AD
) and the real one (us-east-1CfFuncFaiectionCloudFrontFunctionD10DE1AD
)For now, the workaround is just to try again when it fails, and it will usually work within 1-2 retries.
If you need any more information, let me know!
Yep, this looks like the same issue. The workaround mentioned does seem to fix the problem.
Thank you! I should have looked a bit harder 😅