I'm trying to create a VPC endpoint for ABC service in NAWS. My service is deployed in use-az1
, use-az2
, use-az3
, use-az4
, and use-az6
while ABC is deployed in use-az1
, use-az2
, use-az4
, and use-az4
.
My code to create VPC endpoint interface is
private createVpcInterfaceEndpoint(serviceVPCEndpoint: string, serviceName: string): InterfaceVpcEndpoint {
return this.vpc.addInterfaceEndpoint(`${serviceName}-VPCEndpoint`, {
service: {
name: serviceVPCEndpoint,
port: 443,
},
privateDnsEnabled: false,
open: true,
lookupSupportedAzs: true,
});
}
Despite setting lookupSupportedAzs
to true it is still trying to create in subnet use-az3
which is causing deployment failure.
Why is CFN still trying in all subnets?
My cdk.context.json is updated with availability zone of ABC.
"endpoint-service-availability-zones:account=0129501:region=us-east-1:serviceName=com.amazonaws.vpce.us-east-1.vpce-svc-01eb45ffc": [
"us-east-1a",
"us-east-1b",
"us-east-1c",
"us-east-1d"
],
"endpoint-service-availability-zones:account=525995:region=us-west-2:serviceName=com.amazonaws.vpce.us-west-2.vpce-svc-03dca63305": [
"us-west-2a",
"us-west-2b",
"us-west-2c",
"us-west-2d"
],