AWS ALB healthy host count alert alb target group issue

I am trying to create an alert for a AWS ALB minimum healthy host count metric (AWS ALB cloud integration is enabled) using Terraform (newrelic/newrelic provider). I am able to configure the integration provider value of AlbTargetGroup but I am struggling to find any examples as to how to match/filter on the target group name. Could someone point me in the right direction or provide an example please?

Below is how a manually created (working) alert looks like in the console. It’s the Filter Entities/Provider Target Group Name bit that I am not sure how to specify.

The solution is given here

Underlying NRQL query should be something like this

query: "SELECT average(`provider.healthyHostCount.Minimum`), latest(entityName) FROM LoadBalancerSample FACET entityName WHERE (`provider.targetGroupName` = 'aXXXXXXX') AND `provider` = 'AXXXXXX' SINCE 3900 seconds ago UNTIL 300 seconds ago TIMESERIES 60 seconds"