aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.7k stars 3.93k forks source link

aws-ec2: com.amazonaws.<region>.ecr.dkr is not registered in EC2 VPC Endpoint Service #31690

Open shikha372 opened 1 month ago

shikha372 commented 1 month ago

Describe the bug

com.amazonaws.<region>.ecr.dkr is not registered in EC2 VPC Endpoint Service and it fails deployment in some of the isolated regions

Regression Issue

Last Known Working CDK Version

No response

Expected Behavior

Pass deployment in all AWS service regions with correct endpoints for a given service.

Current Behavior

Service in-build failed with this message: The Vpc Endpoint Service 'com.amazonaws..ecr.dkr' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidServiceName; Request ID: c8e338f8-b9b7-4b52-a183-652f57609e24; Proxy: null)

Service in-build failed with this message: The Vpc Endpoint Service 'com.amazonaws..ecr.api' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidServiceName; Request ID: 146880a2-a14b-436e-a90b-fa9761e6d383; Proxy: null)

Reproduction Steps

Deploy a stack with VPC endpoint definition and deploy it in isolated regions like ALE

Possible Solution

Workaround to fix this

Provide endpoint suffix as below to setup the endpoint for a region. const vpce = new ec2.InterfaceVpcEndpointAwsService('ecr.api', 'uk.adc-e.cloud');

Additional Information/Context

No response

CDK CLI Version

2.160.0

Framework Version

No response

Node.js Version

nodejs20

OS

Mac

Language

TypeScript

Language Version

No response

Other information

No response

ashishdhingra commented 1 month ago

Issue opened by CDK team. Making it p2 for now.

khushail commented 1 month ago

related CDK code reference - https://github.com/aws/aws-cdk/blob/4ada3ea4c06bb1f9155bbe2928f64babe4527d0d/packages/aws-cdk-lib/aws-ec2/lib/vpc-endpoint.ts#L103

Cloudformation docs - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/vpc-interface-endpoints.html#vpc-endpoint-create