Score:0

How to retrieve binary file from aws secrets manager using aws cli

pe flag

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 ?

Score:0
pe flag

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
us flag
Thank you, it works.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.