Description
Describe the bug
When attempting to create a VPC endpoint of type Interface for an AWS service the operation fails when both service-name and service-region are specified, even if they are in alignment.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
When creating a VPC interface endpoint for an AWS service, if both service-name and service-region are included in the request and both reference the same region the request should not be blocked by the presence of service-region. Alternatively, if the intended behavior is to discourage the use of these options in combination then either the call should fail with a message that is more helpful than "An internal error has occurred" and ideally the documentation should be updated to mention the conflict between these two options.
Current Behavior
Example command with redacted resource IDs:
aws ec2 create-vpc-endpoint --profile=example \
--vpc-endpoint-type Interface \
--vpc-id vpc-0000000000000000 \
--service-name com.amazonaws.eu-west-1.sts \
--subnet-ids subnet-0000000000000000 \
--security-group-id sg-0000000000000000 \
--tag-specifications "ResourceType=vpc-endpoint,Tags=[{Key=Name,Value=example}]" \
--service-region=eu-west-1
Result:
An error occurred (InternalError) when calling the CreateVpcEndpoint operation (reached max retries: 2): An internal error has occurred
The full output from this command (with resource IDs & security tokens redacted) run in debug mode is included in the attached file, debug-logs.txt.
Reproduction Steps
The only prerequisites are access to an AWS account with a default VPC and IAM access to create the VPC endpoint. The error can be created with a minimal setup referencing the default VPC. Using eu-west-1 as an example region:
aws ec2 create-vpc-endpoint --profile=example \
--vpc-endpoint-type Interface \
--vpc-id vpc-0000000000000000 \
--service-name com.amazonaws.eu-west-1.sts \
--service-region=eu-west-1
Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.23.0 Python/3.12.8 Darwin/24.2.0 source/arm64
Environment details (OS name and version, etc.)
macOS 15.2