Skip to content

Instantly share code, notes, and snippets.

@mrcnc
Last active July 10, 2023 09:39
Show Gist options
  • Save mrcnc/696c2ef357a38dee578ac6a754db6b57 to your computer and use it in GitHub Desktop.
Save mrcnc/696c2ef357a38dee578ac6a754db6b57 to your computer and use it in GitHub Desktop.
aws secrets manager cli usage
aws secretsmanager list-secrets
aws secretsmanager describe-secret \
--secret-id arn:aws:secretsmanager:us-west-2:432117387956:secret:my-db-credentials-Ny5zb7
aws secretsmanager get-secret-value \
--secret-id arn:aws:secretsmanager:us-west-2:432117387956:secret:my-db-credentials-Ny5zb7
aws secretsmanager get-secret-value --secret-id my-db-credentials
aws secretsmanager create-secret \
--name new-secret-name \
--description "Some description about the secret"
aws secretsmanager put-secret-value \
--secret-id arn:aws:secretsmanager:us-west-2:432117387956:secret:my-db-credentials-Ny5zb7 \
--secret-string "{\"username\":\"fuMtSn0aD0mjc0Q7t07dr3QPZqkoyMJW\", \"password\":\"1Tc6_a42t2DyHtta8ydGuQKSSOMZua-J86Z7cwJ44nxpAi3JAPYl8Wwn4U_V3QKy\"}"
# update will overwrite anything that is already stored with whatever you put in secret-string
aws secretsmanager update-secret
--secret-id arn:aws:secretsmanager:us-west-2:432117387956:secret:my-db-credentials-Ny5zb7 \
--secret-string "{\"foo\":\"bar\", \"username\":\"fuMtSn0aD0mjc0Q7t07dr3QPZqkoyMJW\", \"password\":\"1Tc6_a42t2DyHtta8ydGuQKSSOMZua-J86Z7cwJ44nxpAi3JAPYl8Wwn4U_V3QKy\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment