Skip to content

tag async

tag(
    arn: GroupArnV2,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncResourceGroupsClientConfig] = None,
) -> TagOutput

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

Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.

Minimum permissions

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

  • resource-groups:Tag

Parameters:

  • arn (GroupArnV2) –

    The Amazon resource name (ARN) of the resource group to which to add tags.

  • tags (Tags) –

    The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.

Raises:

Source code in docs_src/capo_resource_groups/_services/async_resource_groups.py
async def tag(
    self,
    arn: "capo_resource_groups.types.group_arn_v2.GroupArnV2",
    tags: "capo_resource_groups.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncResourceGroupsClientConfig] = None,
) -> "capo_resource_groups.types.tag_output.TagOutput":
    """<p>Adds tags to a resource group with the specified Amazon resource name (ARN). Existing tags on a resource group are not changed if they are not specified in the request parameters.</p> <important> <p>Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.</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:Tag</code> </p> </li> </ul>

    Args:
        arn: <p>The Amazon resource name (ARN) of the resource group to which to add tags.</p>
        tags: <p>The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resource_groups.types.tag_input.TagInput]",
    ) -> AsyncOperationResponse["capo_resource_groups.types.tag_output.TagOutput"]:
        import capo_resource_groups._operations.ardi.tag

        (
            output,
            http_response,
        ) = await capo_resource_groups._operations.ardi.tag.async_tag(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("Tag")
    )
    input_: capo_resource_groups.types.tag_input.TagInput = {
        "arn": arn,
        "tags": tags,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output