-
Notifications
You must be signed in to change notification settings - Fork 890
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
AWS_PROFILE not respected with aws credentials as environment variables #619
Comments
This seems to me like an issue with the AWS Go SDK and not with sops. We don't really do anything with AWS_PROFILE, unless you pass --aws-profile as a flag, in which case we force usage of that profile here: |
@autrilla I appreciate the quick response! I agree that this possibly is an issue with the AWS Go SDK, I just seem to be running into it when using sops. Interesting note: That --aws-profile does nothing for me. I've tested using that to pass in the name of the aws profile I want to use, but it has the same behavior as not using it. The only way I can successfully use an aws profile is to unset EITHER the |
Apparently |
Could this at all be related to #614 ? As that is giving me a really weird issue realted to --aws-profile |
This should be partially resolved in the new release of sops, as we were not respecting the |
To be honest, after the Creating a new file results in the following error: $ AWS_PROFILE=development sops test.yaml Results in the following error:
But I can use the key just fine with the AWS cli: $ AWS_PROFILE=development aws kms encrypt \
--key-id 11111c1d-b2c8-437d-ae4b-d00a123ccc45 \
--plaintext my-secret-text \
--query CiphertextBlob \
--output text So yeah.... a bit annoying. |
Hi, |
Have you updated to 3.6.1? The AWS SDK was bumped, and it should solve this issue. |
I've upgraded to 3.6.1 and it works. |
I guess we forgot to close it :) |
The Issue
When you have an aws config file setup with a profile, and the credentials are stored as environment variables, sops will ignore the profile and attempt to use the default user instead.
How to reproduce
The aws config is setup with a specific profile
And you have these environment variables set
The expected behavior would be to use the profile
testing
to authenticate with aws and get the kms key. What actually happens is sops uses the default user associated with the access_key and secret_key to get the key, which fails.Workaround
To use the AWS_PROFILE I had to do the following.
I used the aws cli to generate a
~/.aws/credentials
file. I also had to unset theAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
variables.I had to edit the
~/.aws/config
file fromcredential_source = Environment
tosource_profile = default
.Ideal Solution
I would like to be able to use environment variables for my aws credentials with a
AWS_PROFILE
variable set. Needing to build out the credentials file and unset the other variables is extremely cumbersome when I am automating this process.The text was updated successfully, but these errors were encountered: