From 325a99efee9b788a6d22b497a397816b8721ddba Mon Sep 17 00:00:00 2001 From: Grzegorz Huber Date: Wed, 26 Jun 2024 15:34:04 +0200 Subject: [PATCH] [DOC-595] test prod cicd --- bitbucket-pipelines.yml | 35 +++++++++++++++++++ .../other-resources/vars-prod.tfvars | 4 +++ 2 files changed, 39 insertions(+) create mode 100644 devops-pipeline/other-resources/vars-prod.tfvars diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index e01bf18..59a71b7 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -16,6 +16,14 @@ definitions: export AWS_SECRET_ACCESS_KEY=$(echo $STS_OUTPUT | jq -r '.Credentials.SecretAccessKey'); export AWS_SECURITY_TOKEN=$(echo $STS_OUTPUT | jq -r '.Credentials.SessionToken'); export AWS_REGION='us-east-2'; + - script: &aws-context-prod + export AWS_ROLE_ARN=arn:aws:iam::$AWS_ACCOUNT_NO_PROD:role/$OIDC_ROLE_PROD; + export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token; + echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token; + export AWS_ACCESS_KEY_ID=$(echo $STS_OUTPUT | jq -r '.Credentials.AccessKeyId'); + export AWS_SECRET_ACCESS_KEY=$(echo $STS_OUTPUT | jq -r '.Credentials.SecretAccessKey'); + export AWS_SECURITY_TOKEN=$(echo $STS_OUTPUT | jq -r '.Credentials.SessionToken'); + export AWS_REGION='us-east-2'; - script: &ssm-send-command-dev aws ssm send-command --document-name "AWS-RunShellScript" --instance-ids $DEV_INSTANCE_ID_TF --region $AWS_DEFAULT_REGION --parameters commands='[ "sudo -u ubuntu -i <