Skip to content

untag_resource

untag_resource(
    resource_arn: str,
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[SSMIncidentsClientConfig] = None,
) -> UntagResourceResponse

Removes a tag from a resource.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) of the response plan you're removing a tag from.

  • tag_keys (TagKeyList) –

    The name of the tag to remove from the response plan.

Raises:

Source code in docs_src/capo_ssm_incidents/_services/ssm_incidents.py
def untag_resource(
    self,
    resource_arn: str,
    tag_keys: "capo_ssm_incidents.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[SSMIncidentsClientConfig] = None,
) -> "capo_ssm_incidents.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes a tag from a resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the response plan you're removing a tag from.</p>
        tag_keys: <p>The name of the tag to remove from the response plan.</p>

    Raises:
        capo_ssm_incidents.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_incidents.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource causes an inconsistent state.</p>
        capo_ssm_incidents.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_ssm_incidents.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which doesn't exist. </p>
        capo_ssm_incidents.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_incidents.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_incidents.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm_incidents.types.untag_resource_request.UntagResourceRequest]",
    ) -> OperationResponse[
        "capo_ssm_incidents.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_ssm_incidents._operations.ssm_incidents.untag_resource

        output, http_response = (
            capo_ssm_incidents._operations.ssm_incidents.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_ssm_incidents.types.untag_resource_request.UntagResourceRequest = {
        "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