Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(services/s3): environment/config role_arn ignored #4178 #4182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/src/services/s3/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,9 @@ impl Builder for S3Builder {
if let Some(v) = self.config.security_token.take() {
cfg.session_token = Some(v)
}
if let Some(v) = self.config.role_arn.take() {
cfg.role_arn = Some(v)
}

let mut loader: Option<Box<dyn AwsCredentialLoad>> = None;
// If customed_credential_load is set, we will use it.
Expand All @@ -905,7 +908,7 @@ impl Builder for S3Builder {
}

// If role_arn is set, we must use AssumeRoleLoad.
if let Some(role_arn) = self.config.role_arn.take() {
if let Some(role_arn) = cfg.role_arn.take() {
// use current env as source credential loader.
let default_loader = AwsDefaultLoader::new(client.client(), cfg.clone());

Expand Down
Loading