It's not possible and it doesn't make much sense to poll a whole network to see if a server exists or responds.
You can use IPs or hostnames but they will be resolved at startup.
You should add some logic to your cloud scale to add new server to your haproxy load balancer.
From the HAProxy Documentation
server <name> <address>[:[port]] [param*]
Declare a server in a backend
is the internal name assigned to this server. This name will
appear in logs and alerts. If "http-send-name-header" is
set, it will be added to the request header sent to the server.
is the IPv4 or IPv6 address of the server. Alternatively, a
resolvable hostname is supported, but this name will be resolved
during start-up. Address "0.0.0.0" or "*" has a special meaning.
It indicates that the connection will be forwarded to the same IP
address as the one from the client connection. This is useful in
transparent proxy architectures where the client's connection is
intercepted and haproxy must forward to the original destination
address. This is more or less what the "transparent" keyword does
except that with a server it's possible to limit concurrency and
to report statistics. Optionally, an address family prefix may be
used before the address to force the family regardless of the
address format, which can be useful to specify a path to a unix
socket with no slash ('/'). Currently supported prefixes are :
- 'ipv4@' -> address is always IPv4
- 'ipv6@' -> address is always IPv6
- 'unix@' -> address is a path to a local unix socket
- 'abns@' -> address is in abstract namespace (Linux only)
You may want to reference some environment variables in the
address parameter, see section 2.3 about environment
variables. The "init-addr" setting can be used to modify the way
IP addresses should be resolved upon startup.
is an optional port specification. If set, all connections
will
be sent to this port. If unset, the same port the client
connected to will be used. The port may also be prefixed by a "+"
or a "-". In this case, the server's port will be determined by
adding this value to the client's port.
is a list of parameters for this server. The "server"
keywords
accepts an important number of options and has a complete section
dedicated to it. Please refer to section 5 for more details.
Examples :
server first 10.1.1.1:1080 cookie first check inter 1000 server
second 10.1.1.2:1080 cookie second check inter 1000 server transp
ipv4@ server backup "${SRV_BACKUP}:1080" backup server www1_dc1
"${LAN_DC1}.101:80" server www1_dc2 "${LAN_DC2}.101:80"