AWS Config Query Editor - Retrieve EC2 Instance Name and Network Interface Id

0

Hi all,

Tricky one here, but seems possible.

I am attempting to create an AWS EC2 inventory csv file across our AWS Organization. Requirements are to include the EC2 Instance Name and the ENI Network Interface Id's. Using the AWS Config Query editor appears to be the fastest method in a multi-account Organization.

Here is my query so far:

SELECT
  resourceId,
  resourceName,
  resourceType,
  accountId,
  configuration.instanceType,
  configuration.state.name,
  tags,
  configuration.networkInterfaces,
  configuration.publicIp,
  configuration.privateIpAddress
WHERE
  resourceType = 'AWS::EC2::Instance'
  AND configuration.state.name = 'running'

Questions:

  1. How can I get the tags.key "Name" property to display in the output?
  2. How can I get the configuration.networkInterfaces "networkInterfaceId" property to display in the output?

Screenshot attached for reference illustrating the problem. Enter image description here

Here is a link for reference. https://www.virtualbonzo.com/2022/08/08/a-quick-and-easy-ec2-inventory-using-aws-config/

질문됨 일 년 전1383회 조회
2개 답변
1
수락된 답변

Unfortunately both of these properties are nested structures which can't be unpacked by Config queries at this time. That's documented here under the Limitations section.

  • No support for nested structures (such as tags) to be unpacked with SQL queries.
AWS
zsewell
답변함 일 년 전
1

Ahh, thank you. It was buried under the documentation. ...And AWS really needs to populate the resourceName field with the hostname value. That is essential info.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠