Skip to content

Commit e1cc488

Browse files
committed
Use IDMS to get region
1 parent 1f8a2bd commit e1cc488

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packer/linux/conf/docker/cron.hourly/docker-low-disk-gc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mark_instance_unhealthy() {
1717
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60")
1818
aws autoscaling set-instance-health \
1919
--instance-id "$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id)" \
20+
--region "$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/region)" \
2021
--health-status Unhealthy
2122
}
2223

0 commit comments

Comments
 (0)