Skip to content

Instantly share code, notes, and snippets.

@fadeojo
Last active February 3, 2020 06:34
Show Gist options
  • Select an option

  • Save fadeojo/4100221028add2093045af65fb620b07 to your computer and use it in GitHub Desktop.

Select an option

Save fadeojo/4100221028add2093045af65fb620b07 to your computer and use it in GitHub Desktop.
script to create vault config
#!/bin/sh -e
[ $# -lt 2 ] && echo " usage: $0 <dynamo-table> <kms-key>" && exit 1
dynamo_table=$1 && shift
kms_key=$1 && shift
echo "
ui = true
api_addr = \"http://127.0.0.1:8200\"
log_level = \"trace\"
ha_enabled = \"true\"
listener \"tcp\" {
address = \"0.0.0.0:8200\"
tls_disable = 1
}
# storage \"inmem\" {}
storage \"dynamodb\" {
ha_enabled = \"true\"
table = \"$dynamo_table\"
}
seal \"awskms\" {
kms_key_id= \"$kms_key\"
}
" > /etc/vault.d/vault.hcl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment