From 4fd8e5b0cc54a5f3b1a9836c791486c6186b7d99 Mon Sep 17 00:00:00 2001 From: charlie87041 Date: Mon, 23 Oct 2023 12:07:56 -0400 Subject: [PATCH] creating access key secret --- script.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script.sh b/script.sh index 86242bc..4289f16 100644 --- a/script.sh +++ b/script.sh @@ -33,6 +33,11 @@ generate_keys () { BUCKET_ACCESS_KEY=$(echo $RSP | jq -r '.AccessKey.SecretAccessKey') echo "BUCKET_ACCESS_ID=$BUCKET_ACCESS_ID" >> $GITHUB_ENV echo "BUCKET_ACCESS_KEY=$BUCKET_ACCESS_KEY" >> $GITHUB_ENV + # Create a JSON object with BUCKET_ACCESS_ID and BUCKET_ACCESS_KEY + JSON_DATA="{\"BUCKET_ACCESS_ID\":\"$BUCKET_ACCESS_ID\",\"BUCKET_ACCESS_KEY\":\"$BUCKET_ACCESS_KEY\"}" + + # Store the JSON object as a SecureString parameter with the user name as the parameter name + aws ssm put-parameter --name "$USER" --type "SecureString" --value "$JSON_DATA" --region your-region } populate_bucket () { DIREXISTS=$(aws s3 ls s3://$BUCKET/templates/ --region $REGION 2>&1)