Skip to content

Is there a way to get Credentials from aws_config? #268

Answered by rcoh
allan2 asked this question in Q&A
Discussion options

You must be logged in to vote

you can retrieve them from the credentials provider: https://docs.rs/aws-types/0.0.22-alpha/aws_types/config/struct.Config.html#method.credentials_provider

let shared_config = aws_config::from_env().region(region).load().await;
let creds = shared_config
  .credentials_provider().expect("a credentials provider is loaded")
  .provide_credentials().await

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@allan2
Comment options

@rcoh
Comment options

rcoh Oct 28, 2021
Collaborator

@allan2
Comment options

@rcoh
Comment options

rcoh Oct 29, 2021
Collaborator

Answer selected by allan2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants