Skip to content

tag_resource async

tag_resource(
    resource_arn: AppRunnerResourceArn,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncAppRunnerClientConfig] = None,
) -> TagResourceResponse

Add tags to, or update the tag values of, an App Runner resource. A tag is a key-value pair.

Parameters:

  • resource_arn (AppRunnerResourceArn) –

    The Amazon Resource Name (ARN) of the resource that you want to update tags for.

    It must be the ARN of an App Runner resource.

  • tags (TagList) –

    A list of tag key-value pairs to add or update. If a key is new to the resource, the tag is added with the provided value. If a key is already associated with the resource, the value of the tag is updated.

Raises:

Source code in docs_src/capo_apprunner/_services/async_app_runner.py
async def tag_resource(
    self,
    resource_arn: "capo_apprunner.types.app_runner_resource_arn.AppRunnerResourceArn",
    tags: "capo_apprunner.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncAppRunnerClientConfig] = None,
) -> "capo_apprunner.types.tag_resource_response.TagResourceResponse":
    """<p>Add tags to, or update the tag values of, an App Runner resource. A tag is a key-value pair.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to update tags for.</p> <p>It must be the ARN of an App Runner resource.</p>
        tags: <p>A list of tag key-value pairs to add or update. If a key is new to the resource, the tag is added with the provided value. If a key is already associated with the resource, the value of the tag is updated.</p>

    Raises:
        capo_apprunner.errors.internal_service_error_exception.InternalServiceErrorException: <p>An unexpected service exception occurred.</p>
        capo_apprunner.errors.invalid_request_exception.InvalidRequestException: <p>One or more input parameters aren't valid. Refer to the API action's document page, correct the input parameters, and try the action again.</p>
        capo_apprunner.errors.invalid_state_exception.InvalidStateException: <p>You can't perform this action when the resource is in its current state.</p>
        capo_apprunner.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource doesn't exist for the specified Amazon Resource Name (ARN) in your Amazon Web Services account.</p>
        capo_apprunner.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apprunner.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_apprunner.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_apprunner._operations.app_runner.tag_resource

        (
            output,
            http_response,
        ) = await capo_apprunner._operations.app_runner.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_apprunner.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