After uploading a binary secret using something like
aws secretsmanager create-secret --name my-file-secret --secret-binary fileb://mysecret.file
I'm having trouble retrieving the file using the CLI.
How can I do this ?
After uploading a binary secret using something like
aws secretsmanager create-secret --name my-file-secret --secret-binary fileb://mysecret.file
I'm having trouble retrieving the file using the CLI.
How can I do this ?
The secret is stored as a base64 encoded string in the SecretBinary
field of the secret value.
To retrieve it, you need to : get the secret value, extract the SecretBinary
from the resulting JSON, base64 decode it and then save in a file
aws secretsmanager get-secret-value --secret-id $SECRET_ID --query SecretBinary --output text | base64 --decode > myretrievedsecret.file