Skip to content

untag_resource

untag_resource(
    resource_arn: Arn,
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
) -> UntagResourceOutput

Disassociates a resource from a list of tags. The resource is identified by the ResourceArn input parameter. The tags are identified by the list of keys in the TagKeys input parameter.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) that specifies from which resource to disassociate the tags with the keys in the TagKeys input parameter.

  • tag_keys (TagKeyList) –

    A list of keys of Tag objects. The Tag objects identified by the keys are disassociated from the resource specified by the ResourceArn input parameter.

Raises:

Source code in docs_src/capo_codedeploy/_services/code_deploy.py
def untag_resource(
    self,
    resource_arn: "capo_codedeploy.types.arn.Arn",
    tag_keys: "capo_codedeploy.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
) -> "capo_codedeploy.types.untag_resource_output.UntagResourceOutput":
    """<p> Disassociates a resource from a list of tags. The resource is identified by the <code>ResourceArn</code> input parameter. The tags are identified by the list of keys in the <code>TagKeys</code> input parameter. </p>

    Args:
        resource_arn: <p> The Amazon Resource Name (ARN) that specifies from which resource to disassociate the tags with the keys in the <code>TagKeys</code> input parameter. </p>
        tag_keys: <p> A list of keys of <code>Tag</code> objects. The <code>Tag</code> objects identified by the keys are disassociated from the resource specified 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.
    """

    def _handler(
        req: "OperationRequest[capo_codedeploy.types.untag_resource_input.UntagResourceInput]",
    ) -> OperationResponse[
        "capo_codedeploy.types.untag_resource_output.UntagResourceOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.untag_resource

        output, http_response = (
            capo_codedeploy._operations.code_deploy_20141006.untag_resource.untag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_codedeploy.types.untag_resource_input.UntagResourceInput = {
        "resource_arn": resource_arn,
        "tag_keys": tag_keys,
    }

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