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

Bumping AWS GO SDK to 1.38.42 to fix AWS SSO auth woes #29017

Merged
merged 1 commit into from Aug 18, 2021
Merged

Bumping AWS GO SDK to 1.38.42 to fix AWS SSO auth woes #29017

merged 1 commit into from Aug 18, 2021

Conversation

luxifr
Copy link
Contributor

@luxifr luxifr commented Jun 23, 2021

AWS SSO is used in many organizations to authenticate users for access to their AWS accounts. It's the same scale organizations that would very likely also use Terraform to manage their infrastructure. However, proper support for using this authentication scheme landed in the CLI and SDKs only over time, with features like interactive re-authentication (as may be needed when temporary credentials expire) still not universally supported. It's because of this that many people, including myself, will configure their profiles in their local AWS config such that in addition to the SSO configuration, there is a credential_process, which provides backwards compatibility for applications not supporting SSO as well as helps trigger an interactive re-auth as needed (such as aws-sso-util).

For a while the AWS GO SDK derived from the behaviour of all the other AWS SDKs when it comes to handling profiles with this configuration. This has been addressed in aws/aws-sdk-go #3763 and a fix to that merged in aws/aws-sdk-go PR#3763, which landed in aws/aws-sdk-go v1.38.42 and subsequently hashicorp/terraform-provider-aws v3.41.0.

However, this issue not only affected hashicorp/terraform-provider-aws (as initially brought up in #24133) but also affects Terraform itself, specifically when using AWS for storing the state, for example in S3. When using this common profile configuration of both SSO and credential_process simultaneously, terraform init will - because of its outdated AWS GO SDK dependency - fail with

Error: error configuring S3 Backend: Error creating AWS session:
       SharedConfigErr: only one credential type may be specified per profile:
       source profile, credential source, credential process, web identity token, or sso

This pull requests is to bump this dependency to the minimum version needed to fix this issue and achieve consistent behaviour between Terraform itself and its AWS Provider as well compared to most other locally run tools that require AWS authentication.


FYI: The current workaround is to create a separate named profile with only a credentials_process configured to point to the actual SSO profile. This works but it also means essentially duplicating all required profiles which is far from ideal.

@hashicorp-cla
Copy link

hashicorp-cla commented Jun 23, 2021

CLA assistant check
All committers have signed the CLA.

@bnayah
Copy link

bnayah commented Jul 15, 2021

Any status on this PR?

@sylr
Copy link

sylr commented Jul 21, 2021

Duplicate of #28400 & #27777.

Could a maintainer please merge one of those ? @apparentlymart, @jbardin, @bflad ?

@luxifr
Copy link
Contributor Author

luxifr commented Jul 21, 2021

Duplicate of #28400 & #27777.

Could a maintainer please merge one of those ? @apparentlymart, @jbardin, @bflad ?

I took care to determine what was the first version of the Go SDK to handle this properly. If I'm not mistaken then any version before the one I've upgraded to will not fix the issue. Therefore the other two PRs aren't duplicates of this one as they upgrade to versions prior to the one I've ugpraded to.

@sylr
Copy link

sylr commented Jul 22, 2021

Fair enough, just wanted to highlight that we wanted to upgrade this lib for months now in order to fix AWS SSO issues but nothing moved forward so far.

@luxifr
Copy link
Contributor Author

luxifr commented Jul 22, 2021 via email

@danieldrey
Copy link

Really waiting for this PR, there is a reason for the delay?

@sylr
Copy link

sylr commented Aug 15, 2021

@tombuildsstuff @mbfrahry @apparentlymart @jbardin @bflad, could one of you be kind enough to spare some time and review/merge this PR ?

@jbardin
Copy link
Member

jbardin commented Aug 16, 2021

@hashicorp/terraform-aws

…oth SSO config and credential_process at the same time
@gdavison gdavison merged commit 8ff7e65 into hashicorp:main Aug 18, 2021
@gdavison gdavison mentioned this pull request Aug 18, 2021
@luxifr
Copy link
Contributor Author

luxifr commented Aug 18, 2021

ty ♥

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants