Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions Links



Get secret value from AWS Secrets Manager

04 September,2023 by Rambler

Question: Rather than using the AWS Interface - how can I grab the secret value of the AWS secret  using AWS CLI ?


Step 1: AWS Security required to access - secretsmanager:ListSecrets

Step 2 : Find the the actual secret . There could be various sources where you may get the secret , for example it may be in the IaC repository or any other source of truth related to the Asset

--Use the various conditional available to narrow dow the search 

aws secretsmanager list-secrets --query "SecretList[?contains(Name,'a_value')].[*]"


Step 3: Retrieve the secret value 

aws secretsmanager get-secret-value --secret-id my_secret_id --query "SecretString"


AWS CLI Cheatsheet - RDS, AWS Backup , DMS, IAM, Security Token Service,KMS,EC2, DynamoDB,VPC,Aurora, RESOURCEGROUPSTAGGINGAPI

Author: Rambler (


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on Get secret value from AWS Secrets Manager