Skip to content

Instantly share code, notes, and snippets.

@moinuddin14
Last active July 4, 2023 12:56
Show Gist options
  • Save moinuddin14/1fcaebdeab8b5be5aa7a4f8cb04c8fb9 to your computer and use it in GitHub Desktop.
Save moinuddin14/1fcaebdeab8b5be5aa7a4f8cb04c8fb9 to your computer and use it in GitHub Desktop.
image: python:3.7.3
pipelines:
default:
- step:
name: Build and Test
script:
- pipe: atlassian/aws-cli:1.16.283
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-west-2' # your AWS region
COMMAND: 'ssm get-parameters --names "your_parameter_name" --with-decryption'
image: python:3.7.3
pipelines:
default:
- step:
name: Retrieve from AWS Parameter Store
script:
- pipe: atlassian/aws-cli:1.16.283
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-west-2' # your AWS region
COMMAND: 'ssm get-parameters --names "param1 param2 param3 param4 ... param20" --with-decryption'
- |
PARAMETERS_JSON="$COMMAND_OUTPUT"
for i in $(seq 1 20); do
echo "$PARAMETERS_JSON" | jq -r ".Parameters[$((i-1))].Value" > "param$i.txt"
done
artifacts: # defining the artifacts
- param*.txt
- step:
name: Use the Parameters
script:
- |
for i in $(seq 1 20); do
PARAM_VALUE=$(cat "param$i.txt")
echo "Using parameter $i: $PARAM_VALUE"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment