describe_resource_groups

describe_resource_groups(**kwargs)

Describes the resource groups that are specified by the ARNs of the resource groups.

See also: AWS API Documentation

Request Syntax

response = client.describe_resource_groups(
    resourceGroupArns=[
        'string',
    ]
)
Parameters
resourceGroupArns (list) --

[REQUIRED]

The ARN that specifies the resource group that you want to describe.

  • (string) --
Return type
dict
Returns
Response Syntax
{
    'resourceGroups': [
        {
            'arn': 'string',
            'tags': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'createdAt': datetime(2015, 1, 1)
        },
    ],
    'failedItems': {
        'string': {
            'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
            'retryable': True|False
        }
    }
}

Response Structure

  • (dict) --
    • resourceGroups (list) --

      Information about a resource group.

      • (dict) --

        Contains information about a resource group. The resource group defines a set of tags that, when queried, identify the AWS resources that make up the assessment target. This data type is used as the response element in the DescribeResourceGroups action.

        • arn (string) --

          The ARN of the resource group.

        • tags (list) --

          The tags (key and value pairs) of the resource group. This data type property is used in the CreateResourceGroup action.

          • (dict) --

            This data type is used as one of the elements of the ResourceGroup data type.

            • key (string) --

              A tag key.

            • value (string) --

              The value assigned to a tag key.

        • createdAt (datetime) --

          The time at which resource group is created.

    • failedItems (dict) --

      Resource group details that cannot be described. An error code is provided for each failed item.

      • (string) --
        • (dict) --

          Includes details about the failed items.

          • failureCode (string) --

            The status code of a failed item.

          • retryable (boolean) --

            Indicates whether you can immediately retry a request for this item for a specified resource.

Exceptions

  • Inspector.Client.exceptions.InternalException
  • Inspector.Client.exceptions.InvalidInputException

Examples

Describes the resource groups that are specified by the ARNs of the resource groups.

response = client.describe_resource_groups(
    resourceGroupArns=[
        'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI',
    ],
)

print(response)

Expected Output:

{
    'failedItems': {
    },
    'resourceGroups': [
        {
            'arn': 'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI',
            'createdAt': datetime(2016, 3, 15, 20, 36, 31, 1, 75, 0),
            'tags': [
                {
                    'key': 'Name',
                    'value': 'example',
                },
            ],
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}