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

specify resource path for ecs credential url #1228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jedschneider
Copy link

@jedschneider jedschneider commented Nov 8, 2023

Fixes #1229

Problem

According to the AWS Documentation it is expected that the AWS_CONTAINER_CREDENTIALS_FULL_URI env var contains the get-credentials path for example: http://localhost/get-credentials.

We use aws vault exclusively for our AWS access at highwing.io and it works flawlessly when connecting with the SDK or using short-term credentials in a subshell like aws-vault exec account and the --server works fine when using the cli, using vscode AWS Toolkit, etc.

When using the Ruby SDK, the ECS credential server is not being picked up by default, even though the AWS_CONTAINER_CREDENTIALS_FULL_URI is supported by the Ruby SDK (see the :endpoint option).

The ECS credentials are picked up if we override the existing env var:

% export AWS_CONTAINER_CREDENTIALS_FULL_URI=http://127.0.0.1:<port>/get-credentials
% irb
irb(main):001:0> require 'aws-sdk-core'
=> true
irb(main):002:0> client = Aws::STS::Client.new
=> #<Aws::STS::Client>
irb(main):003:0> client.get_caller_identity
=>
#<struct Aws::STS::Types::GetCallerIdentityResponse <redacted>>

and the get-credentials route does not seem to break the cli:

% ENV | grep FULL_URI
AWS_CONTAINER_CREDENTIALS_FULL_URI=http://127.0.0.1:<port>/get-credentials
% aws sts get-caller-identity
{
   <redacted>
}

Suggested Change

I added the get-credentials path to the server address.

This change would prevent a bit of ceremony I need to manage on my side when using the Ruby SDK for localhost development, I'd really appreciate if you would consider the change.

Caution I don't know Go

I ran the tests and had 3 failures before and after the change.

I rake the make task and it failed to build because I don't have a local signing cert (I think).

I'm happy to make any changes to the PR to meet the process of the project, or if its easier, please feel free to take this contribution and run with it. Thanks for such a great tool and I hope this helps adoption!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECS Server URI needs to include the get-credentials path to support AWS SDK Libraries
1 participant