-
-
Notifications
You must be signed in to change notification settings - Fork 354
Description
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:
fog-aws/lib/fog/aws/credential_fetcher.rb
Lines 47 to 52 in 95b1503
| 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:
- If
:use_iam_profileis enabled, useAws::InstanceProfileCredentialsto fetch the access key ID, secret access key, and session token. - Provide a
:credential_fetcheroption that allows the client to delegate the fetching of credentials to another class that implements the same signature.
@geemus What do you think?