Amazon Web Services (AWS) - Create Secret using the AWS CLI
by
Jeremy Canfield |
Updated: August 23 2023
| 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 postgres \
--description "postgres username and password" \
--secret-string "{\"username\":\"john.doe\",\"password\":\"itsasecret\"}"
Something like this should be returned.
{
"ARN": "arn:aws:secretsmanager:us-east-1:123456789012:secret:postgres-tA1FKB",
"Name": "postgres",
"VersionId": "0a8aa38f-b95e-42ab-acc9-7745aa710f23"
}
Did you find this article helpful?
If so, consider buying me a coffee over at