diff --git a/consul-resources/templates/get-aws-creds.sh.ctmpl b/consul-resources/templates/get-aws-creds.sh.ctmpl index 9644056..05b2db2 100644 --- a/consul-resources/templates/get-aws-creds.sh.ctmpl +++ b/consul-resources/templates/get-aws-creds.sh.ctmpl @@ -1,8 +1,6 @@ #!/bin/bash set -e -# WARNING: do not echo anything except ORG ID here - {{ with vault "aws_1h/creds/dock-init" }} export AWS_ACCESS_KEY="{{ .Data.access_key }}" export AWS_SECRET_KEY="{{ .Data.secret_key }}" diff --git a/init.sh b/init.sh index 56cc4dc..3161821 100644 --- a/init.sh +++ b/init.sh @@ -64,7 +64,7 @@ main() { consul::get_environment consul::configure_consul_template dock::generate_certs - aws::get_org_tags + aws::get_org_ids dock::set_hostname dock::set_config_org vault::store_private_registry_token diff --git a/lib/aws.sh b/lib/aws.sh index 2ea7a22..09ab734 100644 --- a/lib/aws.sh +++ b/lib/aws.sh @@ -31,7 +31,7 @@ aws::get_aws_creds() { } # Fetches the org tags from EC2 and sets it to the `ORG_ID` environment variable -aws::get_org_tags() { +aws::get_org_ids() { log::info "Setting Github Org ID" # Generate the org-tag fetching script diff --git a/lib/cleanup.sh b/lib/cleanup.sh index 8d5a4d7..12abd17 100644 --- a/lib/cleanup.sh +++ b/lib/cleanup.sh @@ -13,6 +13,7 @@ cleanup::exit_trap() { "${DOCK_INIT_BASE}"/consul-resources/vault/**/auth-token \ "${DOCK_INIT_BASE}"/consul-resources/vault/**/user-vault-auth-token \ "${DOCK_INIT_BASE}"/consul-resources/vault/**/token-* \ + "${DOCK_INIT_BASE}"/util/get-aws-creds.sh \ "${DOCK_INIT_BASE}"/key/rollbar.token fi }