Icinga2: Apply service to vhosts for each host of a group of hosts

I have a series of web servers (WS1, WS2 and WS3), which belong to the host group "my-web-servers".

Each of these web servers has several vhosts:

  • WS1 to example1.org and example2.org.
  • WS2 at example3.org, example4.org, and example5.org.
  • WS3 has example6.org.

I want to apply a service to them (check_http, which will check the SSL certificate expiration) on ALL virtual hosts of each of the hosts in the host group.

How do I write that? assign where declaration?

What I have up to here:

apply the "SSL certificate" serivce for (host => value in hostgroup.hosts) {
import "active-service-HARD-1day"
check_command "check_ssl_cert"

assign where host.var.vhosts