Skip to content

Commit cd33c6b

Browse files
committed
[aws/sts_provisioner.go] Don't favor on default_region
Default region should only be used to fill in a region when awsConfig.Region doesn't exist (and set it accordingly, but not be the sole determinant on if there is a difference. It should defer to what is already does in the `else if` later, where it sets it if it isn't blank, but doesn't error. Right now, it will error if `default region` is set in the 1Password item, but in reality, it should only do that if `region` (aka: `hasRegularRegion`) is set. This updates this logic to reflect that.
1 parent d36189b commit cd33c6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/aws/sts_provisioner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ Learn how to add an OTP field to your item:
250250
https://developer.1password.com/docs/cli/shell-plugins/aws/#optional-set-up-multi-factor-authentication`, awsConfig.MfaSerial)
251251
}
252252

253-
if hasRegion && awsConfig.Region != "" && region != awsConfig.Region {
254-
return fmt.Errorf("your local AWS configuration (config file or environment variable) has a different default region than the one specified in 1Password")
253+
if hasRegularRegion && awsConfig.Region != "" && region != awsConfig.Region {
254+
return fmt.Errorf("your local AWS configuration (config file or environment variable) has a different region than the one specified in 1Password")
255255
} else if awsConfig.Region == "" {
256256
awsConfig.Region = region
257257
}

0 commit comments

Comments
 (0)