This command gives me the instance name:
curl -X GET http://metadata.google.internal/computeMetadata/v1/instance/name -H 'Metadata-Flavor: Google'
This command gives me the instance zone:
curl -X GET http://metadata.google.internal/computeMetadata/v1/instance/zone -H 'Metadata-Flavor: Google
I can't figure out how to get the instance-group-name similarly?
I need this set self-destruct command in a GCE instance:
gcloud compute instance-groups managed delete-instances $INSTANCE_GROUP_NAME --instances=$NAME --zone=$ZONE