Amazon Web Services (AWS) - Create Secret using the AWS CLI

by
Jeremy Canfield |
Updated: June 02 2024
| Amazon Web Services (AWS) articles
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 create-secret command can be used to create a secret.
aws secretsmanager create-secret \
--name my-secret \
--description "my Secret" \
--secret-string "{\"username\":\"john.doe\",\"password\":\"itsasecret\"}"
Something like this should be returned.
{
"ARN": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret-tA1FKB",
"Name": "my-secret",
"VersionId": "0a8aa38f-b95e-42ab-acc9-7745aa710f23"
}
Did you find this article helpful?
If so, consider buying me a coffee over at