Parsing secrets from AWS secrets manager using AWS cli
Use the --query
option of the CLI to extract just the secret.
aws secretsmanager get-secret-value --secret-id secrets --query SecretString --output text
Small addition to helloV answer. You can add the output parameter text
to remove the quotes.
aws secretsmanager get-secret-value \
--secret-id secrets \
--query SecretString \
--output text
aws secretsmanager get-secret-value --secret-id secrets| jq --raw-output '.SecretString' | jq -r .API_KEY
using jq you can print.