Skip to content

group_resources

group_resources(
    group: GroupStringV2,
    resource_arns: ResourceArnList,
    *,
    config_overrides: Optional[ResourceGroupsClientConfig] = None,
) -> GroupResourcesOutput

Adds the specified resources to the specified group.

You can only use this operation with the following groups:

  • AWS::EC2::HostManagement

  • AWS::EC2::CapacityReservationPool

  • AWS::ResourceGroups::ApplicationGroup

Other resource group types and resource types are not currently supported by this operation.

Minimum permissions

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

  • resource-groups:GroupResources

Parameters:

  • group (GroupStringV2) –

    The name or the Amazon resource name (ARN) of the resource group to add resources to.

  • resource_arns (ResourceArnList) –

    The list of Amazon resource names (ARNs) of the resources to be added to the group.

Raises:

Source code in docs_src/capo_resource_groups/_services/resource_groups.py
def group_resources(
    self,
    group: "capo_resource_groups.types.group_string_v2.GroupStringV2",
    resource_arns: "capo_resource_groups.types.resource_arn_list.ResourceArnList",
    *,
    config_overrides: Optional[ResourceGroupsClientConfig] = None,
) -> "capo_resource_groups.types.group_resources_output.GroupResourcesOutput":
    """<p>Adds the specified resources to the specified group.</p> <important> <p>You can only use this operation with the following groups:</p> <ul> <li> <p> <code>AWS::EC2::HostManagement</code> </p> </li> <li> <p> <code>AWS::EC2::CapacityReservationPool</code> </p> </li> <li> <p> <code>AWS::ResourceGroups::ApplicationGroup</code> </p> </li> </ul> <p>Other resource group types and resource types are not currently supported by this operation.</p> </important> <p> <b>Minimum permissions</b> </p> <p>To run this command, you must have the following permissions:</p> <ul> <li> <p> <code>resource-groups:GroupResources</code> </p> </li> </ul>

    Args:
        group: <p>The name or the Amazon resource name (ARN) of the resource group to add resources to.</p>
        resource_arns: <p>The list of Amazon resource names (ARNs) of the resources to be added to the group. </p>

    Raises:
        capo_resource_groups.errors.bad_request_exception.BadRequestException: <p>The request includes one or more parameters that violate validation rules.</p>
        capo_resource_groups.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request. Check permissions.</p>
        capo_resource_groups.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal error occurred while processing the request. Try again later.</p>
        capo_resource_groups.errors.method_not_allowed_exception.MethodNotAllowedException: <p>The request uses an HTTP method that isn't allowed for the specified resource.</p>
        capo_resource_groups.errors.not_found_exception.NotFoundException: <p>One or more of the specified resources don't exist.</p>
        capo_resource_groups.errors.too_many_requests_exception.TooManyRequestsException: <p>You've exceeded throttling limits by making too many requests in a period of time.</p>
        capo_resource_groups.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_resource_groups.types.group_resources_input.GroupResourcesInput]",
    ) -> OperationResponse[
        "capo_resource_groups.types.group_resources_output.GroupResourcesOutput"
    ]:
        import capo_resource_groups._operations.ardi.group_resources

        output, http_response = (
            capo_resource_groups._operations.ardi.group_resources.group_resources(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GroupResources")
    )
    input_: capo_resource_groups.types.group_resources_input.GroupResourcesInput = {
        "group": group,
        "resource_arns": resource_arns,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output