Skip to content

[AWS Config] How can I retrieve a list of supported resource types via API?

0

We have created a custom Custom Lambda Rule written in Python 3.12 which checks for resource uptime based on tags. We have a requirement wherein the function checks for all resource types currently in use by our organization, and then compares that against a list of resource types to exclude from the compliance check.

I've looked around, and there seems to be no way to retrieve a list of supported resource types in AWS Config via Boto3. Any insight or recommendations regarding this would be greatly appreciated.

asked 2 years ago421 views

1 Answer
0

Hi,

I think that get_aggregate_resource_config does what you need

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/config/client/get_aggregate_resource_config.html

The field resourceType (possible values truncated below) is what you're looking

Response Syntax:

{
    'ConfigurationItem': {
        'version': 'string',
        'accountId': 'string',
        'configurationItemCaptureTime': datetime(2015, 1, 1),
        'configurationItemStatus': 'OK'|'ResourceDiscovered'|'ResourceNotRecorded'|'ResourceDeleted'|'ResourceDeletedNotRecorded',
        'configurationStateId': 'string',
        'configurationItemMD5Hash': 'string',
        'arn': 'string',
        'resourceType': 'AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Host'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway'|' <tec.>
        'resourceId': 'string',
        'resourceName': 'string',
        'awsRegion': 'string',
        'availabilityZone': 'string',
        'resourceCreationTime': datetime(2015, 1, 1),
        'tags': {
            'string': 'string'
        },
        'relatedEvents': [
            'string',
        ],
        'relationships': [
            {
                'resourceType': 'AWS::EC2::CustomerGateway'|'AWS::EC2::EIP'|'AWS::EC2::Host'|'AWS::EC2::Instance'|'AWS::EC2::InternetGateway' <etc>
'resourceId': 'string',
                'resourceName': 'string',
                'relationshipName': 'string'
            },
        ],
        'configuration': 'string',
        'supplementaryConfiguration': {
            'string': 'string'
        },
        'recordingFrequency': 'CONTINUOUS'|'DAILY',
        'configurationItemDeliveryTime': datetime(2015, 1, 1)
    }
}

Best,

Didier

EXPERT

answered 2 years ago

  • Thank you for your answer, Didier. We're not using any aggregators at the moment, and also this function requires a resource identifier as a parameter. We're looking to retrieve the list of supported resource types as is, without having to input resource identifiers or aggregators.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.