Skip to content

remove_tags

remove_tags(
    *,
    config_overrides: Optional[ElasticLoadBalancingv2ClientConfig] = None,
    resource_arns: Optional[ResourceArns] = None,
    tag_keys: Optional[TagKeys] = None,
) -> RemoveTagsOutput

Removes the specified tags from the specified Elastic Load Balancing resources. You can remove the tags for one or more Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, or rules.

Parameters:

  • resource_arns (Optional[ResourceArns], default: None ) –

    The Amazon Resource Name (ARN) of the resource.

  • tag_keys (Optional[TagKeys], default: None ) –

    The tag keys for the tags to remove.

Raises:

Examples:

To remove tags from a load balancer This example removes the specified tags from the specified load balancer.

>>> client.remove_tags(resource_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188'], tag_keys=['project', 'department'])
Source code in docs_src/capo_elastic_load_balancing_v2/_services/elastic_load_balancingv2.py
def remove_tags(
    self,
    *,
    config_overrides: Optional[ElasticLoadBalancingv2ClientConfig] = None,
    resource_arns: Optional[
        "capo_elastic_load_balancing_v2.types.resource_arns.ResourceArns"
    ] = None,
    tag_keys: Optional[
        "capo_elastic_load_balancing_v2.types.tag_keys.TagKeys"
    ] = None,
) -> "capo_elastic_load_balancing_v2.types.remove_tags_output.RemoveTagsOutput":
    """<p>Removes the specified tags from the specified Elastic Load Balancing resources. You can remove the tags for one or more Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, or rules.</p>

    Args:
        resource_arns: <p>The Amazon Resource Name (ARN) of the resource.</p>
        tag_keys: <p>The tag keys for the tags to remove.</p>

    Raises:
        capo_elastic_load_balancing_v2.errors.listener_not_found_exception.ListenerNotFoundException: <p>The specified listener does not exist.</p>
        capo_elastic_load_balancing_v2.errors.load_balancer_not_found_exception.LoadBalancerNotFoundException: <p>The specified load balancer does not exist.</p>
        capo_elastic_load_balancing_v2.errors.rule_not_found_exception.RuleNotFoundException: <p>The specified rule does not exist.</p>
        capo_elastic_load_balancing_v2.errors.target_group_not_found_exception.TargetGroupNotFoundException: <p>The specified target group does not exist.</p>
        capo_elastic_load_balancing_v2.errors.too_many_tags_exception.TooManyTagsException: <p>You've reached the limit on the number of tags for this resource.</p>
        capo_elastic_load_balancing_v2.errors.trust_store_not_found_exception.TrustStoreNotFoundException: <p>The specified trust store does not exist.</p>
        capo_elastic_load_balancing_v2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To remove tags from a load balancer
        This example removes the specified tags from the specified load balancer.

        >>> client.remove_tags(resource_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188'], tag_keys=['project', 'department'])
    """

    def _handler(
        req: "OperationRequest[capo_elastic_load_balancing_v2.types.remove_tags_input.RemoveTagsInput]",
    ) -> OperationResponse[
        "capo_elastic_load_balancing_v2.types.remove_tags_output.RemoveTagsOutput"
    ]:
        import capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.remove_tags

        output, http_response = (
            capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.remove_tags.remove_tags(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveTags")
    )
    input_: capo_elastic_load_balancing_v2.types.remove_tags_input.RemoveTagsInput = {}
    if resource_arns is not None:
        input_["resource_arns"] = resource_arns
    if tag_keys is not None:
        input_["tag_keys"] = tag_keys

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