Last active
July 4, 2023 12:56
-
-
Save moinuddin14/1fcaebdeab8b5be5aa7a4f8cb04c8fb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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