Skip to content

tag_resource async

tag_resource(
    resource_arn: Arn,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
) -> TagResourceOutput

Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.

Parameters:

  • resource_arn (Arn) –

    The ARN of a resource, such as a CodeDeploy application or deployment group.

  • tags (TagList) –

    A list of tags that TagResource associates with a resource. The resource is identified by the ResourceArn input parameter.

Raises:

Source code in docs_src/capo_codedeploy/_services/async_code_deploy.py
async def tag_resource(
    self,
    resource_arn: "capo_codedeploy.types.arn.Arn",
    tags: "capo_codedeploy.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
) -> "capo_codedeploy.types.tag_resource_output.TagResourceOutput":
    """<p> Associates the list of tags in the input <code>Tags</code> parameter with the resource identified by the <code>ResourceArn</code> input parameter. </p>

    Args:
        resource_arn: <p> The ARN of a resource, such as a CodeDeploy application or deployment group. </p>
        tags: <p> A list of tags that <code>TagResource</code> associates with a resource. The resource is identified by the <code>ResourceArn</code> input parameter. </p>

    Raises:
        capo_codedeploy.errors.application_does_not_exist_exception.ApplicationDoesNotExistException: <p>The application does not exist with the user or Amazon Web Services account.</p>
        capo_codedeploy.errors.arn_not_supported_exception.ArnNotSupportedException: <p> The specified ARN is not supported. For example, it might be an ARN for a resource that is not expected. </p>
        capo_codedeploy.errors.deployment_config_does_not_exist_exception.DeploymentConfigDoesNotExistException: <p>The deployment configuration does not exist with the user or Amazon Web Services account.</p>
        capo_codedeploy.errors.deployment_group_does_not_exist_exception.DeploymentGroupDoesNotExistException: <p>The named deployment group with the user or Amazon Web Services account does not exist.</p>
        capo_codedeploy.errors.invalid_arn_exception.InvalidArnException: <p> The specified ARN is not in a valid format. </p>
        capo_codedeploy.errors.invalid_tags_to_add_exception.InvalidTagsToAddException: <p> The specified tags are not valid. </p>
        capo_codedeploy.errors.resource_arn_required_exception.ResourceArnRequiredException: <p> The ARN of a resource is required, but was not found. </p>
        capo_codedeploy.errors.tag_required_exception.TagRequiredException: <p>A tag was not specified.</p>
        capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codedeploy.types.tag_resource_input.TagResourceInput]",
    ) -> AsyncOperationResponse[
        "capo_codedeploy.types.tag_resource_output.TagResourceOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.tag_resource

        (
            output,
            http_response,
        ) = await capo_codedeploy._operations.code_deploy_20141006.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_codedeploy.types.tag_resource_input.TagResourceInput = {
        "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