Skip to content

tag_resource async

tag_resource(
    resource_arn: Arn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncAppConfigClientConfig] = None,
) -> None

Assigns metadata to an AppConfig resource. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define. You can specify a maximum of 50 tags for a resource.

Parameters:

  • resource_arn (Arn) –

    The ARN of the resource for which to retrieve tags.

  • tags (TagMap) –

    The key-value string map. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.

Raises:

Examples:

To tag an application The following tag-resource example tags an application resource.

>>> await client.tag_resource(resource_arn='arn:aws:appconfig:us-east-1:111122223333:application/339ohji', tags={'group1': '1'})
Source code in docs_src/capo_appconfig/_services/async_app_config.py
async def tag_resource(
    self,
    resource_arn: "capo_appconfig.types.arn.Arn",
    tags: "capo_appconfig.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncAppConfigClientConfig] = None,
) -> None:
    """<p>Assigns metadata to an AppConfig resource. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define. You can specify a maximum of 50 tags for a resource.</p>

    Args:
        resource_arn: <p>The ARN of the resource for which to retrieve tags.</p>
        tags: <p>The key-value string map. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with <code>aws:</code>. The tag value can be up to 256 characters.</p>

    Raises:
        capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
        capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To tag an application
        The following tag-resource example tags an application resource.

        >>> await client.tag_resource(resource_arn='arn:aws:appconfig:us-east-1:111122223333:application/339ohji', tags={'group1': '1'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appconfig.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_appconfig._operations.amazon_app_config.tag_resource

        (
            output,
            http_response,
        ) = await capo_appconfig._operations.amazon_app_config.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_appconfig.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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