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 ?
Answer:
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"
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |