-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
cdk: missing ca-west-1 region in aws-entities causes cdk vended custom resources to fail deployment #30694
Comments
Findings:
|
The region has been added but I'm leaving this issue open because the problem of needing to manually add regions for our custom resources to work is not yet resolved. |
Hi @TheRealAmazonKendra, do you know if the change with the region was already released? If no, do you know more or less when we could expect it? (<- I'm referring only to the region, not the larger effort) For now we are pinning v2.145.0 to prevent our pipelines from stopping to work. Thanks! |
Hi @dreamorosi the fix was merged 3 days ago so it will be released in the next version. |
Hey @dreamorosi, are you still running into this issue on the latest release? I am seeing |
Hi @scanlonp - I can confirm that the issue is no longer present in version Thank you all! |
Comments on closed issues and PRs are hard for our team to see. |
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
From 2.146.0 onwards, cdk vended custom resources are now region aware - this change seems to have been introduced in #30108.
To my understanding this means that when deploying a cdk vended custom resource, the
LATEST_NODE_RUNTIME_MAP
is used to lookup the Node.js version to use in the underlying Lambda function.This in turn appears to look up the regions in the
AWS_REGIONS_AND_RULES
map in thepackages/aws-cdk-lib/region-info/lib/aws-entities.ts
file - which is missing an AWS region (ca-west-1
).Expected Behavior
I should be able to deploy a CDK stack that uses cdk-vended custom resources in this region.
Current Behavior
When deploying in
ca-west-1
, the stack fails due to the missing region in theMapping
node of the generated CloudFormation stack:❌ Deployment failed: Error [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::ca-west-1::value
Reproduction Steps
npx aws-cdk@latest init app --language typescript
lib/test-stack.ts
This will generate a cdk vended custom resource because of the
logRetention
prop.npm run cdk synth
to generate the CloudFormation stack filecdk.out/TestStack.template.json
and find theMappings.LatestNodeRuntimeMap
ca-west-1
region is missing from the mappingca-west-1
viaexport AWS_REGION=ca-west-1
❌ TestStack failed: Error [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::ca-west-1::value
Possible Solution
No response
Additional Information/Context
My team Powertools for AWS Lambda deploys Lambda layers in all regions, including the missing one.
We discovered the issue in our canaries which were now failing to deploy in
ca-west-1
. Downgrading to 2.145.0 fixed the issue.CDK CLI Version
2.146.0
Framework Version
No response
Node.js Version
20.x
OS
Linux, Mac
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: