Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SecretsManagerをdotenv形式に変換するやつ
#!/bin/bash -e
# SecretsManagerから取ってきたJSONのSecretStringをバラして、dotenv形式に変換する
# https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/get-secret-value.html
SECRET_ID="$1"
aws secretsmanager get-secret-value \
--secret-id "${SECRET_ID}" \
--query SecretString \
| jq -r 'fromjson | keys[] as $k | "\($k)=\"\(.[$k])\""'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.