def _filter_ignored_distributions(distributions, **kwargs):
    """
    Look up tags and remove any CloudFront distributions that should be ignored based on tags.
    :param distributions: List of CloudFront distribution items
    :param kwargs: must contain a 'client' from @sts_client
    :return: Filtered list of distributions
    """
    if not distributions:
        return distributions

    # Get the ignore tag configuration
    ignore_tags = current_app.config.get("AWS_CLOUDFRONT_IGNORE_TAGS", [])

    if not ignore_tags:
        return distributions

    try:
        client = kwargs.pop("client")
        filtered_distributions = []

        # AWS CloudFront only allows one ARN per call to list_tags_for_resource, so we need to loop
        for distribution in distributions:
            distribution_arn = distribution.get("ARN")
            if not distribution_arn:
                filtered_distributions.append(distribution)
                continue

            tags_response = client.list_tags_for_resource(Resource=distribution_arn)
            tags = tags_response.get("Tags", {}).get("Items", [])

            # If the distribution has any ignore tags, skip it
            if any(tag["Key"] == ignore_tag for tag in tags for ignore_tag in ignore_tags):
                current_app.logger.info(f"Ignoring CloudFront distribution due to ignore tag: {distribution.get('Id')}")
                continue

            filtered_distributions.append(distribution)

        return filtered_distributions

    except Exception as e:
        metrics.send("list_tags_for_resource_error", "counter", 1, metric_tags={"error": str(e)})
        capture_exception()
        raise

    Look up tags and remove any CloudFront distributions that should be ignored based on tags.
    :param distributions: List of CloudFront distribution items
    :param kwargs: must contain a 'client' from @sts_client
    :return: Filtered list of distributions
    
lemur/plugins/lemur_aws/cloudfront.py