Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix Provision Host CI/CD workflow (#2644)

Dennis Kuijs2c3d072ba74c
diff --git a/.ci_cd/aws/provision_account.sh b/.ci_cd/aws/provision_account.sh
index 51a83f096..bbe8cc0ac 100644
--- a/.ci_cd/aws/provision_account.sh
+++ b/.ci_cd/aws/provision_account.sh
@@ -175,7 +175,7 @@ if [ "$VPCID" == 'None' ]; then
fi
# Create standard stack resources in specified account
- STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --parameters $PARAMS --output text $ACCOUNT_PROFILE)
+ STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --parameters $PARAMS --query 'StackId' --output text $ACCOUNT_PROFILE)
# Wait for CloudFormation stack status to be CREATE_*
echo "Waiting for stack to be created"
@@ -300,7 +300,7 @@ else
fi
# Create SSM Documents for attaching, detaching and replacing an EBS data volume in specified account
- STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --output text $ACCOUNT_PROFILE)
+ STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --query 'StackId' --output text $ACCOUNT_PROFILE)
if [ $? -ne 0 ]; then
echo "Create stack failed"
@@ -348,7 +348,7 @@ else
fi
# Create dashboard in specified account
- STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --output text $ACCOUNT_PROFILE)
+ STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --query 'StackId' --output text $ACCOUNT_PROFILE)
if [ $? -ne 0 ]; then
echo "Create stack failed"
diff --git a/.ci_cd/aws/provision_host.sh b/.ci_cd/aws/provision_host.sh
index 716dcce4f..9efe0e1f8 100644
--- a/.ci_cd/aws/provision_host.sh
+++ b/.ci_cd/aws/provision_host.sh
@@ -97,7 +97,7 @@ else
PARAMS="ParameterKey=UserName,ParameterValue='$SMTP_STACK_NAME'"
# Create standard stack resources in specified account
- STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $SMTP_STACK_NAME --template-body file://$SMTP_TEMPLATE_PATH --parameters $PARAMS --output text)
+ STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $SMTP_STACK_NAME --template-body file://$SMTP_TEMPLATE_PATH --parameters $PARAMS --query 'StackId' --output text)
if [ $? -ne 0 ]; then
echo "Create stack failed"
@@ -235,7 +235,7 @@ EOF
# Look for EFS mount target in caller account for the same availability zone ID (no costs if within same AZ) - Don't use name as name to IDs vary between accounts
EFS_ID=$(aws efs describe-file-systems --query "FileSystems[?Name=='or-map-efs'].FileSystemId" --output text)
EFS_DNS=$(aws efs describe-mount-targets --file-system-id $EFS_ID --query "MountTargets[?AvailabilityZoneId=='$SUBNET_AZ'].IpAddress" --output text)
-
+
# Get role to be assumed by DLM
ROLE_ARN="arn:aws:iam::$AWS_ACCOUNT_ID:role/$AWS_ROLE_NAME-$AWS_REGION"
@@ -249,7 +249,7 @@ EOF
PARAMS="$PARAMS ParameterKey=DLMExecutionRoleArn,ParameterValue=$ROLE_ARN"
# Create standard stack resources in specified account
- STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --parameters $PARAMS --output text $ACCOUNT_PROFILE)
+ STACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --parameters $PARAMS --query 'StackId' --output text $ACCOUNT_PROFILE)
if [ $? -ne 0 ]; then
echo "Create stack failed"
@@ -358,7 +358,7 @@ else
PARAMS="ParameterKey=Host,ParameterValue='$HOST'"
# Create standard stack resources in specified account in us-east-1 region
- STACK_ID=$(aws cloudformation create-stack --stack-name $HEALTH_STACK_NAME --template-body file://$HEALTH_TEMPLATE_PATH --parameters $PARAMS --output text $ACCOUNT_PROFILE --region us-east-1)
+ STACK_ID=$(aws cloudformation create-stack --stack-name $HEALTH_STACK_NAME --template-body file://$HEALTH_TEMPLATE_PATH --parameters $PARAMS --query 'StackId' --output text $ACCOUNT_PROFILE --region us-east-1)
if [ $? -ne 0 ]; then
echo "Create stack failed"