@@ -6,16 +6,16 @@ echo "Retrieving TOKEN from AWS API"
66token=$( curl -f -X PUT " http://169.254.169.254/latest/api/token" -H " X-aws-ec2-metadata-token-ttl-seconds: 180" )
77
88region=$( curl -f -H " X-aws-ec2-metadata-token: $token " -v http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region)
9- echo " Reteieved REGION from AWS API ($region )"
9+ echo " Retrieved REGION from AWS API ($region )"
1010
1111instance_id=$( curl -f -H " X-aws-ec2-metadata-token: $token " -v http://169.254.169.254/latest/meta-data/instance-id)
12- echo " Reteieved INSTANCE_ID from AWS API ($instance_id )"
12+ echo " Retrieved INSTANCE_ID from AWS API ($instance_id )"
1313
1414tags=$( aws ec2 describe-tags --region " $region " --filters " Name=resource-id,Values=$instance_id " )
1515echo " Retrieved tags from AWS API ($tags )"
1616
1717environment=$( echo " $tags " | jq -r ' .Tags[] | select(.Key == "ghr:environment") | .Value' )
18- echo " Reteieved ghr:environment tag - ($environment )"
18+ echo " Retrieved ghr:environment tag - ($environment )"
1919
2020parameters=$( aws ssm get-parameters-by-path --path " /$environment /runner" --region " $region " --query " Parameters[*].{Name:Name,Value:Value}" )
2121echo " Retrieved parameters from AWS SSM ($parameters )"
@@ -29,7 +29,7 @@ echo "Retrieved /$environment/runner/enable-cloudwatch parameter - ($enable_clou
2929agent_mode=$( echo " $parameters " | jq --arg environment " $environment " -r ' .[] | select(.Name == "/\($environment)/runner/agent-mode") | .Value' )
3030echo " Retrieved /$environment /runner/agent-mode parameter - ($agent_mode )"
3131
32- if [[ -n " $enable_cloudwatch_agent " ]]; then
32+ if [[ " $enable_cloudwatch_agent " == " true " ]]; then
3333 echo " Cloudwatch is enabled"
3434 amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c " ssm:$environment -cloudwatch_agent_config_runner"
3535fi
0 commit comments