Skip to content

untag_resource

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

Deletes tags from an Application Auto Scaling scalable target. To delete a tag, specify the tag key and the Application Auto Scaling scalable target.

Parameters:

  • resource_arn (AmazonResourceName) –

    Identifies the Application Auto Scaling scalable target from which to remove tags.

    For example: arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123

    To get the ARN for a scalable target, use DescribeScalableTargets.

  • tag_keys (TagKeyList) –

    One or more tag keys. Specify only the tag keys, not the tag values.

Raises:

Examples:

To remove a tag from a scalable target This example removes the tag pair with the key name "environment" from the scalable target specified by its ARN.

>>> client.untag_resource(resource_arn='arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123', tag_keys=['environment'])
Source code in docs_src/capo_application_auto_scaling/_services/application_auto_scaling.py
def untag_resource(
    self,
    resource_arn: "capo_application_auto_scaling.types.amazon_resource_name.AmazonResourceName",
    tag_keys: "capo_application_auto_scaling.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[ApplicationAutoScalingClientConfig] = None,
) -> "capo_application_auto_scaling.types.untag_resource_response.UntagResourceResponse":
    """<p>Deletes tags from an Application Auto Scaling scalable target. To delete a tag, specify the tag key and the Application Auto Scaling scalable target.</p>

    Args:
        resource_arn: <p>Identifies the Application Auto Scaling scalable target from which to remove tags.</p> <p>For example: <code>arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123</code> </p> <p>To get the ARN for a scalable target, use <a>DescribeScalableTargets</a>.</p>
        tag_keys: <p>One or more tag keys. Specify only the tag keys, not the tag values.</p>

    Raises:
        capo_application_auto_scaling.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_application_auto_scaling.errors.validation_exception.ValidationException: <p>An exception was thrown for a validation issue. Review the available parameters for the API request.</p>
        capo_application_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To remove a tag from a scalable target
        This example removes the tag pair with the key name "environment" from the scalable target specified by its ARN.

        >>> client.untag_resource(resource_arn='arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123', tag_keys=['environment'])
    """

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

        output, http_response = (
            capo_application_auto_scaling._operations.any_scale_frontend_service.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_application_auto_scaling.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