-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Release 4.2.0 changes authentication behaviour #23407
Comments
Hi @morfien101, thanks for opening this issue. Version 4 of the AWS provider has changes to the authentication flow to bring it in line with the behaviour of the AWS CLI and the default behaviour of the AWS SDKs. For more information, see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade#changes-to-authentication. Most cases where we've seen this reported define both a provider "aws" {
profile = "example-profile"
} If that is not the case, can you please share the details of your provider configuration block? |
We do define the profile in the provider block as you stated. Our use case is like so: |
Thank you for your response, @morfien101. This is expected behaviour starting with version 4.
|
Hi @gdavison, since this is expected now, and the gospel spread far and wide in the past was "use the profile parameter in the provider blocks", is there a recommended new way to use this provider? I'm in the same boat as @morfien101 above. I'm expecting a lot of people to be hit by this problem in the future, and think an official recommendation would perhaps be better than just shutting the door without any further discourse. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
There appears to be a change in behaviour with the AWS Creds chain.
On version 3.74.0 the ENV vars are selected first and requests will us these values for the API calls.
In version 4.2.0 the EC2 Instance role appears to be selected first, in our case this causes authentication failures.
We found this with our Jenkins agents. We pass in credentials to the agent using the withCredentials function which will set the auth env vars
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
andAWS_SESSION_TOKEN
. However we get a failure like this:This is not the case in 3.74.0
Maybe this change?
#23282
The text was updated successfully, but these errors were encountered: