Bootstrap FreeKB - Amazon Web Services (AWS) - Update Secret using the AWS CLI
Amazon Web Services (AWS) - Update Secret using the AWS CLI


This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

The aws secretsmanager put-secret-value command can be used to update the key/value pairs in a secret.

aws secretsmanager put-secret-value \
--secret-string "{\"username\":\"john.doe\",\"password\":\"mynewpassword\"}" \
--secret-id arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret-SgNa1s

 

Optionally, the --version option can be used to create a new version of the secret.

aws secretsmanager put-secret-value \
--secret-string "{\"username\":\"john.doe\",\"password\":\"mynewpassword\"}" \
--secret-id arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret-SgNa1s \
--version 2

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 02ba3b in the box below so that we can be sure you are a human.