-
Is there a way to get let shared_config = aws_config::from_env().region(region).load().await;
let creds = aws_types::Credentials::new(
dotenv!("AWS_ACCESS_KEY_ID"), // <--- get this from shared_config
dotenv!("AWS_SECRET_ACCESS_KEY"), // <--- get this from shared_config
None,
None,
"provider_name",
); |
Beta Was this translation helpful? Give feedback.
Answered by
rcoh
Oct 28, 2021
Replies: 1 comment 4 replies
-
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 |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
allan2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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