Skip to content

Commit 7377eba

Browse files
committed
Update terminate-instance to use new region IDMS api
1 parent a476080 commit 7377eba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packer/linux/conf/buildkite-agent/scripts/terminate-instance

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sleep 10
88

99
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60")
1010
instance_id=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -fsSL http://169.254.169.254/latest/meta-data/instance-id)
11-
region=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -fsSL http://169.254.169.254/latest/meta-data/placement/availability-zone | head -c -1)
11+
region=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -fsSL http://169.254.169.254/latest/meta-data/placement/region)
1212

1313
echo "requesting instance termination..."
1414

0 commit comments

Comments
 (0)