ResourceGroups

Table of Contents

Client

class ResourceGroups.Client

A low-level client representing AWS Resource Groups:

client = session.create_client('resource-groups')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
create_group(**kwargs)

Creates a group with a specified name, description, and resource query.

See also: AWS API Documentation

Request Syntax

response = client.create_group(
    Name='string',
    Description='string',
    ResourceQuery={
        'Type': 'TAG_FILTERS_1_0',
        'Query': 'string'
    },
    Tags={
        'string': 'string'
    }
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the group, which is the identifier of the group in other operations. A resource group name cannot be updated after it is created. A resource group name can have a maximum of 128 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws ; these are reserved. A resource group name must be unique within your account.

  • Description (string) -- The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.
  • ResourceQuery (dict) --

    [REQUIRED]

    The resource query that determines which AWS resources are members of this group.

    • Type (string) -- [REQUIRED]

      The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

      • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
    • Query (string) -- [REQUIRED]

      The query that defines a group or a search.

  • Tags (dict) --

    The tags to add to the group. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{
    'Group': {
        'GroupArn': 'string',
        'Name': 'string',
        'Description': 'string'
    },
    'ResourceQuery': {
        'Type': 'TAG_FILTERS_1_0',
        'Query': 'string'
    },
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      A full description of the resource group after it is created.

      • GroupArn (string) --

        The ARN of a resource group.

      • Name (string) --

        The name of a resource group.

      • Description (string) --

        The description of the resource group.

    • ResourceQuery (dict) --

      The resource query associated with the group.

      • Type (string) --

        The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

        • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
      • Query (string) --

        The query that defines a group or a search.

    • Tags (dict) --

      The tags associated with the group.

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

delete_group(**kwargs)

Deletes a specified resource group. Deleting a resource group does not delete resources that are members of the group; it only deletes the group structure.

See also: AWS API Documentation

Request Syntax

response = client.delete_group(
    GroupName='string'
)
Parameters
GroupName (string) --

[REQUIRED]

The name of the resource group to delete.

Return type
dict
Returns
Response Syntax
{
    'Group': {
        'GroupArn': 'string',
        'Name': 'string',
        'Description': 'string'
    }
}

Response Structure

  • (dict) --
    • Group (dict) --

      A full description of the deleted resource group.

      • GroupArn (string) --

        The ARN of a resource group.

      • Name (string) --

        The name of a resource group.

      • Description (string) --

        The description of the resource group.

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_group(**kwargs)

Returns information about a specified resource group.

See also: AWS API Documentation

Request Syntax

response = client.get_group(
    GroupName='string'
)
Parameters
GroupName (string) --

[REQUIRED]

The name of the resource group.

Return type
dict
Returns
Response Syntax
{
    'Group': {
        'GroupArn': 'string',
        'Name': 'string',
        'Description': 'string'
    }
}

Response Structure

  • (dict) --
    • Group (dict) --

      A full description of the resource group.

      • GroupArn (string) --

        The ARN of a resource group.

      • Name (string) --

        The name of a resource group.

      • Description (string) --

        The description of the resource group.

get_group_query(**kwargs)

Returns the resource query associated with the specified resource group.

See also: AWS API Documentation

Request Syntax

response = client.get_group_query(
    GroupName='string'
)
Parameters
GroupName (string) --

[REQUIRED]

The name of the resource group.

Return type
dict
Returns
Response Syntax
{
    'GroupQuery': {
        'GroupName': 'string',
        'ResourceQuery': {
            'Type': 'TAG_FILTERS_1_0',
            'Query': 'string'
        }
    }
}

Response Structure

  • (dict) --
    • GroupQuery (dict) --

      The resource query associated with the specified group.

      • GroupName (string) --

        The name of a resource group that is associated with a specific resource query.

      • ResourceQuery (dict) --

        The resource query which determines which AWS resources are members of the associated resource group.

        • Type (string) --

          The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

          • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
        • Query (string) --

          The query that defines a group or a search.

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_tags(**kwargs)

Returns a list of tags that are associated with a resource, specified by an ARN.

See also: AWS API Documentation

Request Syntax

response = client.get_tags(
    Arn='string'
)
Parameters
Arn (string) --

[REQUIRED]

The ARN of the resource for which you want a list of tags. The resource must exist within the account you are using.

Return type
dict
Returns
Response Syntax
{
    'Arn': 'string',
    'Tags': {
        'string': 'string'
    }
}

Response Structure

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

      The ARN of the tagged resource.

    • Tags (dict) --

      The tags associated with the specified resource.

      • (string) --
        • (string) --
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_group_resources(**kwargs)

Returns a list of ARNs of resources that are members of a specified resource group.

See also: AWS API Documentation

Request Syntax

response = client.list_group_resources(
    GroupName='string',
    Filters=[
        {
            'Name': 'resource-type',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the resource group.

  • Filters (list) --

    Filters, formatted as ResourceFilter objects, that you want to apply to a ListGroupResources operation.

    • resource-type - Filter resources by their type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.
    • (dict) --

      A filter name and value pair that is used to obtain more specific results from a list of resources.

      • Name (string) -- [REQUIRED]

        The name of the filter. Filter names are case-sensitive.

      • Values (list) -- [REQUIRED]

        One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.

        • (string) --
  • MaxResults (integer) -- The maximum number of group member ARNs that are returned in a single call by ListGroupResources, in paginated output. By default, this number is 50.
  • NextToken (string) -- The NextToken value that is returned in a paginated ListGroupResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.
Return type

dict

Returns

Response Syntax

{
    'ResourceIdentifiers': [
        {
            'ResourceArn': 'string',
            'ResourceType': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ResourceIdentifiers (list) --

      The ARNs and resource types of resources that are members of the group that you specified.

      • (dict) --

        The ARN of a resource, and its resource type.

        • ResourceArn (string) --

          The ARN of a resource.

        • ResourceType (string) --

          The resource type of a resource, such as AWS::EC2::Instance .

    • NextToken (string) --

      The NextToken value to include in a subsequent ListGroupResources request, to get more results.

list_groups(**kwargs)

Returns a list of existing resource groups in your account.

See also: AWS API Documentation

Request Syntax

response = client.list_groups(
    MaxResults=123,
    NextToken='string'
)
Parameters
  • MaxResults (integer) -- The maximum number of resource group results that are returned by ListGroups in paginated output. By default, this number is 50.
  • NextToken (string) -- The NextToken value that is returned in a paginated ListGroups request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.
Return type

dict

Returns

Response Syntax

{
    'Groups': [
        {
            'GroupArn': 'string',
            'Name': 'string',
            'Description': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Groups (list) --

      A list of resource groups.

      • (dict) --

        A resource group.

        • GroupArn (string) --

          The ARN of a resource group.

        • Name (string) --

          The name of a resource group.

        • Description (string) --

          The description of the resource group.

    • NextToken (string) --

      The NextToken value to include in a subsequent ListGroups request, to get more results.

search_resources(**kwargs)

Returns a list of AWS resource identifiers that matches a specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.

See also: AWS API Documentation

Request Syntax

response = client.search_resources(
    ResourceQuery={
        'Type': 'TAG_FILTERS_1_0',
        'Query': 'string'
    },
    MaxResults=123,
    NextToken='string'
)
Parameters
  • ResourceQuery (dict) --

    [REQUIRED]

    The search query, using the same formats that are supported for resource group definition.

    • Type (string) -- [REQUIRED]

      The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

      • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
    • Query (string) -- [REQUIRED]

      The query that defines a group or a search.

  • MaxResults (integer) -- The maximum number of group member ARNs returned by SearchResources in paginated output. By default, this number is 50.
  • NextToken (string) -- The NextToken value that is returned in a paginated SearchResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.
Return type

dict

Returns

Response Syntax

{
    'ResourceIdentifiers': [
        {
            'ResourceArn': 'string',
            'ResourceType': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ResourceIdentifiers (list) --

      The ARNs and resource types of resources that are members of the group that you specified.

      • (dict) --

        The ARN of a resource, and its resource type.

        • ResourceArn (string) --

          The ARN of a resource.

        • ResourceType (string) --

          The resource type of a resource, such as AWS::EC2::Instance .

    • NextToken (string) --

      The NextToken value to include in a subsequent SearchResources request, to get more results.

tag(**kwargs)

Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.

See also: AWS API Documentation

Request Syntax

response = client.tag(
    Arn='string',
    Tags={
        'string': 'string'
    }
)
Parameters
  • Arn (string) --

    [REQUIRED]

    The ARN of the resource to which to add tags.

  • Tags (dict) --

    [REQUIRED]

    The tags to add to the specified resource. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{
    'Arn': 'string',
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • Arn (string) --

      The ARN of the tagged resource.

    • Tags (dict) --

      The tags that have been added to the specified resource.

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

untag(**kwargs)

Deletes specified tags from a specified resource.

See also: AWS API Documentation

Request Syntax

response = client.untag(
    Arn='string',
    Keys=[
        'string',
    ]
)
Parameters
  • Arn (string) --

    [REQUIRED]

    The ARN of the resource from which to remove tags.

  • Keys (list) --

    [REQUIRED]

    The keys of the tags to be removed.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'Arn': 'string',
    'Keys': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • Arn (string) --

      The ARN of the resource from which tags have been removed.

    • Keys (list) --

      The keys of tags that have been removed.

      • (string) --

update_group(**kwargs)

Updates an existing group with a new or changed description. You cannot update the name of a resource group.

See also: AWS API Documentation

Request Syntax

response = client.update_group(
    GroupName='string',
    Description='string'
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the resource group for which you want to update its description.

  • Description (string) -- The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.
Return type

dict

Returns

Response Syntax

{
    'Group': {
        'GroupArn': 'string',
        'Name': 'string',
        'Description': 'string'
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The full description of the resource group after it has been updated.

      • GroupArn (string) --

        The ARN of a resource group.

      • Name (string) --

        The name of a resource group.

      • Description (string) --

        The description of the resource group.

update_group_query(**kwargs)

Updates the resource query of a group.

See also: AWS API Documentation

Request Syntax

response = client.update_group_query(
    GroupName='string',
    ResourceQuery={
        'Type': 'TAG_FILTERS_1_0',
        'Query': 'string'
    }
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the resource group for which you want to edit the query.

  • ResourceQuery (dict) --

    [REQUIRED]

    The resource query that determines which AWS resources are members of the resource group.

    • Type (string) -- [REQUIRED]

      The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

      • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
    • Query (string) -- [REQUIRED]

      The query that defines a group or a search.

Return type

dict

Returns

Response Syntax

{
    'GroupQuery': {
        'GroupName': 'string',
        'ResourceQuery': {
            'Type': 'TAG_FILTERS_1_0',
            'Query': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • GroupQuery (dict) --

      The resource query associated with the resource group after the update.

      • GroupName (string) --

        The name of a resource group that is associated with a specific resource query.

      • ResourceQuery (dict) --

        The resource query which determines which AWS resources are members of the associated resource group.

        • Type (string) --

          The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

          • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
        • Query (string) --

          The query that defines a group or a search.

Paginators

The available paginators are:

class ResourceGroups.Paginator.ListGroupResources
paginator = client.get_paginator('list_group_resources')
paginate(**kwargs)

Creates an iterator that will paginate through responses from ResourceGroups.Client.list_group_resources().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    GroupName='string',
    Filters=[
        {
            'Name': 'resource-type',
            'Values': [
                'string',
            ]
        },
    ],
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the resource group.

  • Filters (list) --

    Filters, formatted as ResourceFilter objects, that you want to apply to a ListGroupResources operation.

    • resource-type - Filter resources by their type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.
    • (dict) --

      A filter name and value pair that is used to obtain more specific results from a list of resources.

      • Name (string) -- [REQUIRED]

        The name of the filter. Filter names are case-sensitive.

      • Values (list) -- [REQUIRED]

        One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.

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

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'ResourceIdentifiers': [
        {
            'ResourceArn': 'string',
            'ResourceType': 'string'
        },
    ],

}

Response Structure

  • (dict) --

    • ResourceIdentifiers (list) --

      The ARNs and resource types of resources that are members of the group that you specified.

      • (dict) --

        The ARN of a resource, and its resource type.

        • ResourceArn (string) --

          The ARN of a resource.

        • ResourceType (string) --

          The resource type of a resource, such as AWS::EC2::Instance .

class ResourceGroups.Paginator.ListGroups
paginator = client.get_paginator('list_groups')
paginate(**kwargs)

Creates an iterator that will paginate through responses from ResourceGroups.Client.list_groups().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
PaginationConfig (dict) --

A dictionary that provides parameters to control pagination.

  • MaxItems (integer) --

    The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

  • PageSize (integer) --

    The size of each page.

  • StartingToken (string) --

    A token to specify where to start paginating. This is the NextToken from a previous response.

Return type
dict
Returns
Response Syntax
{
    'Groups': [
        {
            'GroupArn': 'string',
            'Name': 'string',
            'Description': 'string'
        },
    ],

}

Response Structure

  • (dict) --
    • Groups (list) --

      A list of resource groups.

      • (dict) --

        A resource group.

        • GroupArn (string) --

          The ARN of a resource group.

        • Name (string) --

          The name of a resource group.

        • Description (string) --

          The description of the resource group.

class ResourceGroups.Paginator.SearchResources
paginator = client.get_paginator('search_resources')
paginate(**kwargs)

Creates an iterator that will paginate through responses from ResourceGroups.Client.search_resources().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    ResourceQuery={
        'Type': 'TAG_FILTERS_1_0',
        'Query': 'string'
    },
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • ResourceQuery (dict) --

    [REQUIRED]

    The search query, using the same formats that are supported for resource group definition.

    • Type (string) -- [REQUIRED]

      The type of the query. The valid value in this release is TAG_FILTERS_1_0 .

      • TAG_FILTERS_1_0: * A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. When more than one element is present, only resources that match all filters are part of the result. If a filter specifies more than one value for a key, a resource matches the filter if its tag value matches any of the specified values.
    • Query (string) -- [REQUIRED]

      The query that defines a group or a search.

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'ResourceIdentifiers': [
        {
            'ResourceArn': 'string',
            'ResourceType': 'string'
        },
    ],

}

Response Structure

  • (dict) --

    • ResourceIdentifiers (list) --

      The ARNs and resource types of resources that are members of the group that you specified.

      • (dict) --

        The ARN of a resource, and its resource type.

        • ResourceArn (string) --

          The ARN of a resource.

        • ResourceType (string) --

          The resource type of a resource, such as AWS::EC2::Instance .