Skip to content

Commit

Permalink
fix: add parameters to account creation for ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sbstjn committed Mar 23, 2021
1 parent 889d080 commit b3de700
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ phases:
- aws configure --profile test_account set credential_source EcsContainer

# setup superwerker in vended account
- aws --profile test_account --region ${SUPERWERKER_REGION} cloudformation create-stack --stack-name superwerker --template-body file://templates/superwerker.template.yaml --parameters ParameterKey=Domain,ParameterValue=${ROOT_MAIL_DOMAIN} ParameterKey=Subdomain,ParameterValue=${aws_account_id} ParameterKey=QSS3BucketName,ParameterValue=${TEMPLATE_BUCKET_NAME} ParameterKey=QSS3BucketRegion,ParameterValue=${TEMPLATE_REGION} ParameterKey=QSS3KeyPrefix,ParameterValue=${TEMPLATE_PREFIX} --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM --disable-rollback
- aws --profile test_account --region ${SUPERWERKER_REGION} cloudformation create-stack --stack-name superwerker --template-body file://templates/superwerker.template.yaml --parameters ParameterKey=Domain,ParameterValue=${ROOT_MAIL_DOMAIN} ParameterKey=Subdomain,ParameterValue=${aws_account_id} ParameterKey=QSS3BucketName,ParameterValue=${TEMPLATE_BUCKET_NAME} ParameterKey=QSS3BucketRegion,ParameterValue=${TEMPLATE_REGION} ParameterKey=QSS3KeyPrefix,ParameterValue=${TEMPLATE_PREFIX} ParameterKey=NotificationsMail,ParameterValue=root+notifications@${aws_account_id}.${ROOT_MAIL_DOMAIN} --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM --disable-rollback
- sleep 10 # work around race condition when multiple aws cli processes want to create the cache: [Errno 17] File exists: '/root/.aws/cli/cache'
- while ! domain_name_servers=$(aws --profile test_account --region ${SUPERWERKER_REGION} ssm get-parameter --name /superwerker/domain_name_servers --query Parameter.Value --output text); do sleep 10; done
- aws cloudformation deploy --stack-name superwerker-pipeline-dns-wiring-${aws_account_id} --template-file tests/pipeline-dns-wiring.yaml --parameter-overrides RootMailDelegationTarget=$domain_name_servers RootMailDomain=${ROOT_MAIL_DOMAIN} RootMailSubdomain=${aws_account_id} --no-fail-on-empty-changeset
Expand Down
2 changes: 1 addition & 1 deletion tests/setup-test-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ aws configure --profile test_account_${aws_account_id} --region ${superwerker_re
aws sts get-caller-identity --profile test_account_${aws_account_id} --region ${superwerker_region} --no-cli-pager

# setup superwerker in vended account
aws --profile test_account_${aws_account_id} --region ${superwerker_region} cloudformation deploy --stack-name superwerker --template-file templates/superwerker.template.yaml --parameter-overrides Domain=${ROOT_MAIL_DOMAIN} Subdomain=${aws_account_id} QSS3BucketName=${TEMPLATE_BUCKET_NAME} QSS3BucketRegion=${TEMPLATE_REGION} QSS3KeyPrefix=${TEMPLATE_PREFIX} --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM --no-fail-on-empty-changeset &
aws --profile test_account_${aws_account_id} --region ${superwerker_region} cloudformation deploy --stack-name superwerker --template-file templates/superwerker.template.yaml --parameter-overrides Domain=${ROOT_MAIL_DOMAIN} Subdomain=${aws_account_id} NotificationsMail=root+notifications@${aws_account_id}.${ROOT_MAIL_DOMAIN} QSS3BucketName=${TEMPLATE_BUCKET_NAME} QSS3BucketRegion=${TEMPLATE_REGION} QSS3KeyPrefix=${TEMPLATE_PREFIX} --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM --no-fail-on-empty-changeset &
while ! domain_name_servers=$(aws --profile test_account_${aws_account_id} --region ${superwerker_region} ssm get-parameter --name /superwerker/domain_name_servers --query Parameter.Value --output text); do sleep 10; done
aws --profile ${SOURCE_PROFILE} cloudformation deploy --stack-name superwerker-pipeline-dns-wiring-${aws_account_id} --template-file tests/pipeline-dns-wiring.yaml --parameter-overrides RootMailDelegationTarget=$domain_name_servers RootMailDomain=${ROOT_MAIL_DOMAIN} RootMailSubdomain=${aws_account_id} NotificationsMail=root+notifications@${aws_account_id}.${ROOT_MAIL_DOMAIN} --no-fail-on-empty-changeset
sleep 1800 # give superwerker stack time to finish (Control Tower needs ~30min)
Expand Down

0 comments on commit b3de700

Please sign in to comment.