Closed Henry01234 closed 2 days ago
error handler returned message: "Value (dummy1a) for parameter availabilityZone is invalid. Subnets can currently only be created in the following availability zones: us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1e, us-east-1f. (Service: Ec2, Status Code: 400, Request ID: d5e85ac0-9386-494c-8db5-a2ff7501f77f)" (RequestToken: 2f242e5e-1a76-b08a-1177-01e4f5af8f84, HandlerErrorCode: InvalidRequest)
Can you share your CDK code snippet that returns this error?
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Status
Resolved
What is the issue?
The issue is related to how AWS CDK assigns availability zones (AvailabilityZone) during the creation of subnets. AWS CDK typically manages availability zones automatically based on the regions and availability zones available to your AWS account. However, sometimes there might be issues where AWS CDK incorrectly assigns an availability zone that is not valid or expected.
Error message
What is the impact?
It makes it difficult to make use of CDK Script to provision resources on AWS
Workaround
We can use this to create the VPC And Subnet separately, so it doesn't need to assign dummy1a to the Subnet created with (SubnetConfiguration)... init { // Create VPC with no subnets initially val vpc = Vpc(this, "myVpc-01", VpcProps.builder() .cidr("10.0.0.0/16") .subnetConfiguration(emptyList()) .build())
Who is affected?
Devolopers, Software Engineers and Cloud Engineers
How do I resolve this?
make sure to read the Documentation properly. And check the ### Workaround I provided It worked!! https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Subnet.html
Related issues
..