ResourceGroups / Client / ungroup_resources

ungroup_resources#

ResourceGroups.Client.ungroup_resources(**kwargs)#

Removes the specified resources from the specified group. This operation works only with static groups that you populated using the GroupResources operation. It doesn’t work with any resource groups that are automatically populated by tag-based or CloudFormation stack-based queries.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:UngroupResources

See also: AWS API Documentation

Request Syntax

response = client.ungroup_resources(
    Group='string',
    ResourceArns=[
        'string',
    ]
)
Parameters:
  • Group (string) –

    [REQUIRED]

    The name or the ARN of the resource group from which to remove the resources.

  • ResourceArns (list) –

    [REQUIRED]

    The ARNs of the resources to be removed from the group.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'Succeeded': [
        'string',
    ],
    'Failed': [
        {
            'ResourceArn': 'string',
            'ErrorMessage': 'string',
            'ErrorCode': 'string'
        },
    ],
    'Pending': [
        {
            'ResourceArn': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • Succeeded (list) –

      A list of resources that were successfully removed from the group by this operation.

      • (string) –

    • Failed (list) –

      A list of any resources that failed to be removed from the group by this operation.

      • (dict) –

        A resource that failed to be added to or removed from a group.

        • ResourceArn (string) –

          The ARN of the resource that failed to be added or removed.

        • ErrorMessage (string) –

          The error message text associated with the failure.

        • ErrorCode (string) –

          The error code associated with the failure.

    • Pending (list) –

      A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the ``ListGroupResources ``operation. After the resource is successfully removed, it no longer appears in the response.

      • (dict) –

        A structure that identifies a resource that is currently pending addition to the group as a member. Adding a resource to a resource group happens asynchronously as a background task and this one isn’t completed yet.

        • ResourceArn (string) –

          The Amazon resource name (ARN) of the resource that’s in a pending state.

Exceptions

  • ResourceGroups.Client.exceptions.BadRequestException

  • ResourceGroups.Client.exceptions.ForbiddenException

  • ResourceGroups.Client.exceptions.NotFoundException

  • ResourceGroups.Client.exceptions.MethodNotAllowedException

  • ResourceGroups.Client.exceptions.TooManyRequestsException

  • ResourceGroups.Client.exceptions.InternalServerErrorException