Issues when trying to override CLI credentials on an EC2 instance #7795
-
I am creating an IAM User and then generating CLI credentials for that user. On an EC2 instance I would like to use these credentials for CLI commands instead of using the EC2 instance profile permissions. I attempt to create a new credentials file and update it with the following commands.
I can read the creds file and I see a [test] block with credentials below that. I try to run
Is there something I'm doing incorrectly here? Is there a security token associated to the default profile or EC2 instance profile that is being used with the credentials for the test profile? One command which worked during testing was |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @rankol, thanks for reaching out. Having a token invalid error on I was able successfully make my profile using the same process you followed, but it might be worth it for you to try another method. Could you try making your profile by importing CSV credentials? Here's the associated documentation for that, specifically the section on using named profiles and
If you want to use these credentials for all commands without needing to specify them using Let me know if that works for you, or if you have any follow-up questions. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi @rankol, thanks for reaching out. Having a token invalid error on
get-caller-identity
is definitely strange, since that command doesn't require any permissions. Do you haveaws_session_token
in your profile orAWS_SESSION_TOKEN
as an environment variable? If so, try clearing it.I was able successfully make my profile using the same process you followed, but it might be worth it for you to try another method. Could you try making your profile by importing CSV credentials? Here's the associated documentation for that, specifically the section on using named profiles and
aws configure import
, but I'll go over the steps.