Skip to content

Consider using AWS SDK for CredentialFetcher #723

Description

@stanhu

As discussed in #721, the Fog::AWS::CredentialFetcher continues to lag support for IAM access since AWS continues to add functionality.

The latest issue we ran into is that while the AWS SDK allows full configuration of the STS endpoint via the AWS_ENDPOINT_URL_STS (https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html, https://docs.aws.amazon.com/sdkref/latest/guide/ss-endpoints-table.html) environment variable, Fog::AWS::CredentialFetcher only supports regional endpoints:

sts_endpoint =
if ENV["AWS_STS_REGIONAL_ENDPOINTS"] == "regional" && region
"https://sts.#{region}.amazonaws.com"
else
"https://sts.amazonaws.com"
end

Now obviously we can add support for this environment variable, but this seems pretty inefficient as we have always been behind the curve.

I'd like to propose one of two avenues:

  1. If :use_iam_profile is enabled, use Aws::InstanceProfileCredentials to fetch the access key ID, secret access key, and session token.
  2. Provide a :credential_fetcher option that allows the client to delegate the fetching of credentials to another class that implements the same signature.

@geemus What do you think?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions