Skip to content

Commit

Permalink
Properly handle nested hierarchical SSM parameter names to stop varia…
Browse files Browse the repository at this point in the history
…ble shadowing; replace usages of 'enabled' with full name
  • Loading branch information
malessi committed Jan 17, 2025
1 parent 4e61e54 commit c8c60fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Force UTC time
export TZ=UTC

export BFD_CCW_JOB_ENABLED={{ enabled if pipeline_instance_type == 'ccw' else 'false' }} {# derived from terraform control plane #}{{ '\n' }}
export BFD_RDA_JOB_ENABLED={{ enabled if pipeline_instance_type == 'rda' else 'false' }} {# derived from terraform control plane #}{{ '\n' }}
export BFD_CCW_JOB_ENABLED={{ job_enabled if pipeline_instance_type == 'ccw' else 'false' }} {# derived from terraform control plane #}{{ '\n' }}
export BFD_RDA_JOB_ENABLED={{ job_enabled if pipeline_instance_type == 'rda' else 'false' }} {# derived from terraform control plane #}{{ '\n' }}

export BFD_DB_URL='{{ db_url }}'

Expand Down
6 changes: 3 additions & 3 deletions ops/terraform/services/pipeline/user-data.sh.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ aws ssm get-parameters-by-path \
--path "/bfd/${env}/pipeline/nonsensitive/${pipeline_instance}" \
--recursive \
--region us-east-1 \
--query 'Parameters' | jq 'map({(.Name|split("/")|last): .Value})|add' > pipeline_vars.json
--query 'Parameters' | jq 'map({(.Name|split("/")[6:]|join("_")): .Value})|add' > pipeline_vars.json

# shared pipeline variables
aws ssm get-parameters-by-path \
--path "/bfd/${env}/pipeline/nonsensitive/" \
--region us-east-1 \
--query 'Parameters' | jq 'map({(.Name|split("/")|last): .Value})|add' > shared_pipeline_vars.json
--query 'Parameters' | jq 'map({(.Name|split("/")[5:]|join("_")): .Value})|add' > shared_pipeline_vars.json

# common service variables
aws ssm get-parameters-by-path \
--path "/bfd/${env}/common/nonsensitive/" \
--recursive \
--region us-east-1 \
--query 'Parameters' | jq 'map({(.Name|split("/")|last): .Value})|add' > common_vars.json
--query 'Parameters' | jq 'map({(.Name|split("/")[5:]|join("_")): .Value})|add' > common_vars.json

new_relic_sensitive="$(aws ssm get-parameters-by-path \
--with-decryption \
Expand Down

0 comments on commit c8c60fd

Please sign in to comment.