Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AWS config query sample - get ec2 instances with public IP address
SELECT
accountId,
configuration.instancdId,
configuration.publicIp,
configuration.ipv6Addresses
WHERE
resourceType = 'AWS::EC2::Instance'
AND (
configuration.publicIp BETWEEN '0.0.0.0'
AND '255.255.255.255'
OR configuration.ipv6Addresses BETWEEN '0:0:0:0:0:0:0:0'
AND 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment