how can i change a variable from a value format in a secret manager from aws?

aws secretsmanager get-secret-value --secret-id XXXXX | jq --raw-output '.SecretString' | jq '.' | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]"

that will do it

Broken down:

aws secretsmanager get-secret-value --secret-id XXXXX retrieves specific secret

jq --raw-output '.SecretString' filters out only secret value

jq '.' formats is as json again (might not be necessary strictly speaking)

jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" remaps the json format to key=value

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top