<commit_before>#!/bin/bash

aws cloudformation validate-template --template-body file://cloudformation/myblog.json
if [ "$?" -ne 0 ]; then
   echo "error: invalid cloudformation template. exiting..."
   exit 1
fi

# ubuntu/images-testing/hvm-ssd/ubuntu-yakkety-daily-amd64-server-20170303.1 - ami-0f6fb419
output=$(aws cloudformation create-stack --stack-name example-5-9-stack --template-body \
file://cloudformation/myblog.json \
--region us-east-1 --capabilities CAPABILITY_IAM \
--parameters ParameterKey=AMI,ParameterValue=ami-0f6fb419 \
ParameterKey=KeyName,ParameterValue=RobertHughes)

if [ "$?" -eq 0 ]; then
   stackid=$(echo "$output" | grep "StackId" | awk '{ print $2 }')
   echo "info: waiting for stack creation to complete..."
   aws cloudformation wait stack-create-complete --stack-name "$stackid"
else
   echo "error: non-zero result returned from 'aws cloudformation command'"
fi
<commit_msg>Update helper script to wait for CloudFormation stack creation to complete.<commit_after>#!/bin/bash

aws cloudformation validate-template --template-body file://cloudformation/myblog.json
if [ "$?" -ne 0 ]; then
   echo "error: invalid cloudformation template. exiting..."
   exit 1
fi

# ubuntu/images-testing/hvm-ssd/ubuntu-yakkety-daily-amd64-server-20170303.1 - ami-0f6fb419
output=$(aws cloudformation create-stack --stack-name example-5-9-stack --template-body \
file://cloudformation/myblog.json \
--region us-east-1 --capabilities CAPABILITY_IAM \
--parameters ParameterKey=AMI,ParameterValue=ami-0f6fb419 \
ParameterKey=KeyName,ParameterValue=RobertHughes)

if [ "$?" -eq 0 ]; then
   stackid=$(echo "$output" | grep "StackId" | awk '{ print $2 }' | tr -d '"')
   echo "info: waiting for stack creation to complete for stack ID ${stackid}..."
   aws cloudformation wait stack-create-complete --stack-name $stackid
else
   echo "error: non-zero result returned from 'aws cloudformation' command"
fi

{'fraction_non_alphanumeric': 0.1359375, 'fraction_numerical': 0.029166666666666667, 'mean_word_length': 4.23433242506812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6417527', 'n_tokens_mistral': 642, 'n_tokens_neox': 585, 'n_words': 158}