awslabs / aws-config-resource-schema

AWS Config resource schema define the properties and types of AWS Config resource configuration items (CIs). Resource CI schema are used by developers when performing advanced resource queries and when processing CI data.
Apache License 2.0
237 stars 61 forks source link

Query Editor: Selecting tags as output columns #10

Open Wenzil opened 4 years ago

Wenzil commented 4 years ago

Hello there,

Can you add functionality to select resource tags as columns?

For example, this query would output a Name column and contain the name of every EC2 instance:

SELECT
  resourceId,
  tag.Name
WHERE
  resourceType = 'AWS::EC2::Instance'
jprakash402 commented 4 years ago

I'm looking for something similar to this. Is there a way to fetch, values from array?

SELECT
  configuration.natGatewayAddresses.networkInterfaceId,
  configuration.natGatewayAddresses.privateIp,
  configuration.natGatewayAddresses.publicIp,
  resourceId
WHERE
  resourceType = 'AWS::EC2::NatGateway'

The above query is giving empty values instead of actual data.

renanr0ssi commented 3 years ago

Hello there,

Can you add functionality to select resource tags as columns?

For example, this query would output a Name column and contain the name of every EC2 instance:

SELECT
  resourceId,
  tag.Name
WHERE
  resourceType = 'AWS::EC2::Instance'

Did you find any way to do this? I'm in the same situation!

alanreynosov commented 3 years ago

Any Update? there's lot of resources with No resourceName but Tag Name, this capability would be great

alanreynosov commented 3 years ago

there's a workaround, sending config outputs to a bucket and query with AWS Athena and json_extract_scalar;

SELECT resourceId, json_extract_scalar(tags.key, '$.Name') as Name

https://aws.amazon.com/blogs/mt/how-to-query-your-aws-resource-configuration-states-using-aws-config-and-amazon-athena/

albertorm95 commented 1 year ago

Looks like there is no intention of developing this

runjivu commented 1 week ago

Not being able to query by resource name (witch is commonly in tag key "Name") is critical. I really hope they work on this