Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws sts get-call-identity doesn't work for correct AWS_EC2_METADATA_SERVICE_ENDPOINT #9281

Open
1 task
darren-wen opened this issue Feb 6, 2025 · 1 comment
Labels
bug This issue is a bug. ec2 p2 This is a standard priority issue

Comments

@darren-wen
Copy link

Describe the bug

export AWS_EC2_METADATA_SERVICE_ENDPOINT=http://localhost.trade-dev.flexport.com:59279
aws sts get-caller-identity

Invalid endpoint EC2 Instance Metadata endpoint: http://localhost.trade-dev.flexport.com:59279latest/api/token

if I add a / at the end, the aws cli works, but the java SDK breaks.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

the aws cli can work with http://localhost.trade-dev.flexport.com:59279(no trailing /)

Current Behavior

the aws cli doesn't work with http://localhost.trade-dev.flexport.com:59279, it throws

Invalid endpoint EC2 Instance Metadata endpoint: http://localhost.trade-dev.flexport.com:59279latest/api/token

Reproduction Steps

export AWS_EC2_METADATA_SERVICE_ENDPOINT=http://localhost.trade-dev.flexport.com:59279 # make sure you have a valid endpoint like this
aws sts get-caller-identity

Possible Solution

It looks like the aws cli implementation literally appends the latest/api/token to the endpoint to construct the final URL. We can use some URL tools to construct the final URL to avoid the / issue.

Additional Information/Context

No response

CLI version used

aws-cli/2.23.13 Python/3.12.8 Darwin/23.6.0 source/arm64

Environment details (OS name and version, etc.)

macOS Sonoma Version 14.7 (23H124)

@darren-wen darren-wen added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 6, 2025
@ashovlin
Copy link
Member

ashovlin commented Feb 6, 2025

Likely addressed via #8967

@khushail khushail added p2 This is a standard priority issue ec2 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. ec2 p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants