Skip to content

[request]: aws-config: Allow to set load_timeout when constructing with DefaultCredentialsChain #462

@yerke

Description

@yerke

A note for the community

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue, please leave a comment

Tell us about your request

Provide a way to set load_timeout on LazyCachingCredentialsProvider when constructing with DefaultCredentialsChain. Right now I don't see a way to override it without reimplementing DefaultCredentialsChain.

Tell us about the problem you're trying to solve.

I was getting Error: failed to construct request: Failed to load credentials from the credentials provider: Credentials provider timed out after 5 seconds when trying to get secret from aws_sdk_secretsmanager::Client.

Are you currently working around this issue?

I had to use WebIdentityTokenCredentialsProvider directly, which is not recommended AFAIK.

Additional context

aws-config = "0.6.0"
aws-sdk-secretsmanager = "0.6.0"
aws-types = "0.6.0"

This code was causing the issue.

let config = aws_config::from_env().load().await;
let client = Client::new(config);
let response = client.get_secret_value().secret_id("secret").send().await?;

Had to change into this

let provider = WebIdentityTokenCredentialsProvider::builder()
        .configure(&ProviderConfig::with_default_region().await)
        .build();
let config = aws_config::from_env()
        .credentials_provider(provider)
        .load()
        .await;
let client = Client::new(config);
let response = client.get_secret_value().secret_id("secret").send().await?;

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions