Skip to content

Commit

Permalink
feat: skip failures when fetching from SSM
Browse files Browse the repository at this point in the history
  • Loading branch information
harishv7 committed Sep 20, 2023
1 parent a5a1b87 commit 67d6fe4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .platform/hooks/predeploy/06_fetch_ssm_parameters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ aws configure set default.region ap-southeast-1

for ENV_VAR in "${ENV_VARS[@]}"; do
echo "Fetching ${ENV_VAR} from SSM"

# Attempt to fetch the parameter; if it fails, skip to the next iteration of the loop
VALUE=$(aws ssm get-parameter --name "${ENV_TYPE}_${ENV_VAR}" --with-decryption --query "Parameter.Value" --output text)

if [ $? -ne 0 ]; then
echo "Failed to fetch ${ENV_VAR}. Skipping."
continue
fi

echo "${ENV_VAR}=${VALUE}" >> /tmp/isomer/.isomer.env
echo "Saved ${ENV_VAR}"
done
Expand Down

0 comments on commit 67d6fe4

Please sign in to comment.