Last active
December 11, 2020 08:09
-
-
Save knishioka/b0c422b912d9dc2a6747294db525c983 to your computer and use it in GitHub Desktop.
Update AWS Access Key by awscli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
username= | |
current_access_key=$(aws configure get aws_access_key_id) | |
aws=$(aws iam create-access-key --user-name $username) | |
aws configure set aws_access_key_id $(jq -r '.AccessKey.AccessKeyId' <<< $aws) | |
aws configure set aws_secret_access_key $(jq -r '.AccessKey.SecretAccessKey' <<< $aws) | |
aws iam delete-access-key --access-key-id $current_access_key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment