-
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: deploying to Govcloud region givesError [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::us-gov-west-1::value
#30977
Comments
According to this added in #30108, it should contain GovCloud aws-cdk/packages/aws-cdk-lib/aws-lambda/test/function.test.ts Lines 4074 to 4180 in 31808b4
But from my test with 2.150.0 new lambda.Function(this, 'Lambda', {
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.determineLatestNodeRuntime(this),
}); The LatestNodeRuntimeMap mapping does not contain GovCloud. "Mappings": {
"LatestNodeRuntimeMap": {
"af-south-1": {
"value": "nodejs20.x"
},
"ap-east-1": {
"value": "nodejs20.x"
},
"ap-northeast-1": {
"value": "nodejs20.x"
},
"ap-northeast-2": {
"value": "nodejs20.x"
},
"ap-northeast-3": {
"value": "nodejs20.x"
},
"ap-south-1": {
"value": "nodejs20.x"
},
"ap-south-2": {
"value": "nodejs20.x"
},
"ap-southeast-1": {
"value": "nodejs20.x"
},
"ap-southeast-2": {
"value": "nodejs20.x"
},
"ap-southeast-3": {
"value": "nodejs20.x"
},
"ap-southeast-4": {
"value": "nodejs20.x"
},
"ap-southeast-5": {
"value": "nodejs20.x"
},
"ap-southeast-7": {
"value": "nodejs20.x"
},
"ca-central-1": {
"value": "nodejs20.x"
},
"ca-west-1": {
"value": "nodejs20.x"
},
"cn-north-1": {
"value": "nodejs18.x"
},
"cn-northwest-1": {
"value": "nodejs18.x"
},
"eu-central-1": {
"value": "nodejs20.x"
},
"eu-central-2": {
"value": "nodejs20.x"
},
"eu-north-1": {
"value": "nodejs20.x"
},
"eu-south-1": {
"value": "nodejs20.x"
},
"eu-south-2": {
"value": "nodejs20.x"
},
"eu-west-1": {
"value": "nodejs20.x"
},
"eu-west-2": {
"value": "nodejs20.x"
},
"eu-west-3": {
"value": "nodejs20.x"
},
"il-central-1": {
"value": "nodejs20.x"
},
"me-central-1": {
"value": "nodejs20.x"
},
"me-south-1": {
"value": "nodejs20.x"
},
"mx-central-1": {
"value": "nodejs20.x"
},
"sa-east-1": {
"value": "nodejs20.x"
},
"us-east-1": {
"value": "nodejs20.x"
},
"us-east-2": {
"value": "nodejs20.x"
},
"us-west-1": {
"value": "nodejs20.x"
},
"us-west-2": {
"value": "nodejs20.x"
}
}
}, It's probably a bug. We'll discuss this with the team. |
By the way @RossMeyers Creating a new VPC should not generate the Did you define any other resources in addition to the Vpc? const vpc = new ec2.Vpc(this, 'SandboxVpc1',{
ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
subnetConfiguration: [
{
cidrMask: 24,
name: 'public',
subnetType: ec2.SubnetType.PUBLIC,
},
{
cidrMask: 24,
name: 'private',
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
}
]
}) |
@pahud no just the VPC. It looks like it was called as part of a lambda to remove security group rules when |
Yes you are right. According to this: aws-cdk/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts Lines 1115 to 1121 in 31808b4
aws-cdk/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts Lines 1694 to 1696 in 31808b4
aws-cdk/packages/aws-cdk-lib/aws-ec2/lib/vpc.ts Lines 1895 to 1924 in 31808b4
restrictDefaultSecurityGroup is a feature flag which default is |
As a workaround, please update this feature flag (@aws-cdk/core:target-partitions) to include So in your app's
This should give you both GovCloud regions. Removing the entry altogether will populate the mapping with values for all regions. |
Hey @RossMeyers, hope this fixes your issue - please let us know if something is still not working for you! Also, setting a region in your stack's I am going to edit the description of this issue to make it more findable and make the workaround clear. |
Error [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::us-gov-west-1::value
Error [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::us-gov-west-1::value
Error [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::us-gov-west-1::value
Workaround
If you run into this error, there are a couple ways to work around it:
@aws-cdk/core:target-partitions
feature flag in yourcdk.json
filea. Remove the flag entirely - it limits what is rendered in the mappings, so it is not needed
b. Add the partition you are missing, for example:
env
, for exampleIf you are a deploying into Govcloud or iso regions, you should change/remove the feature flag no matter what.
Original Issue Below
Describe the bug
I create a new VPC, synth, and try to deploy to AWS Govcloud and get
Error [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::us-gov-west-1::value
. TheLatestNodeRuntimeMap
that was added a month ago does not include the two govcloud regions.Expected Behavior
cdk deploy
does not error out and govcloud regions are part of the mapping.Current Behavior
cdk deploy
fails withError [ValidationError]: Template error: Unable to get mapping for LatestNodeRuntimeMap::us-gov-west-1::value
Reproduction Steps
cdk synth
cdk deploy
- region is us-gov-east-1 or us-gov-west-1Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
3.150.0
Framework Version
No response
Node.js Version
22.5.1
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: