Skip to content

Instantly share code, notes, and snippets.

@atheiman
Last active June 24, 2025 15:28
Show Gist options
  • Save atheiman/6b79b8d082c1b27104b7bad203b607f0 to your computer and use it in GitHub Desktop.
Save atheiman/6b79b8d082c1b27104b7bad203b607f0 to your computer and use it in GitHub Desktop.
AWS Config aggregator advanced query (SQL-like syntax) SELECT statement for resources where a tag key equals a tag value
# https://docs.aws.amazon.com/config/latest/developerguide/querying-AWS-resources.html
# Select EC2 instances from all accounts and regions with tag key "updateAutomationEnabled" is set to value "true"
aws configservice select-aggregate-resource-config \
--configuration-aggregator-name org-config-aggregator \
--expression "SELECT resourceId, resourceType, tags
WHERE resourceType = 'AWS::EC2::Instance'
AND tags.tag = 'updateAutomationEnabled=true'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment