Created
July 14, 2022 16:46
-
-
Save adamcrosby/d49afb9a2ce39731a35e967b00b50e10 to your computer and use it in GitHub Desktop.
Get EC2 instance ID from a 'Name' tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
resourceId, | |
resourceName, | |
resourceType, | |
configuration.instanceType, | |
tags, | |
availabilityZone, | |
configuration.state.name | |
WHERE | |
resourceType = 'AWS::EC2::Instance' | |
AND tags.key = 'Name' | |
AND tags.value = 'SERVERNAME' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment