File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,21 @@ set -o xtrace
99
1010pip3 install --break-system-packages https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz
1111
12+ # Ensure AWS_STACK and AWS_REGION are available. If not set in the current
13+ # environment, try loading them from /etc/environment (CloudFormation writes
14+ # these there in userdata). Use safe expansions to avoid nounset failures.
15+ if [ -z " ${AWS_STACK:- } " ] || [ -z " ${AWS_REGION:- } " ]; then
16+ if [ -f /etc/environment ]; then
17+ . /etc/environment || true
18+ fi
19+ fi
20+
21+ if [ -z " ${AWS_STACK:- } " ] || [ -z " ${AWS_REGION:- } " ]; then
22+ echo " Required AWS variables AWS_STACK or AWS_REGION not set" >&2
23+ exit 1
24+ fi
25+
1226# sending the finish call
13- cfn-signal -e 0 --stack ${AWS_STACK} --resource BrowserInstance --region ${AWS_REGION}
27+ cfn-signal -e 0 --stack " ${AWS_STACK} " --resource BrowserInstance --region " ${AWS_REGION} "
1428
1529echo " Instance is ready"
You can’t perform that action at this time.
0 commit comments