We have following issue. All our test instances are using the only one target server, which is a simple HAProxy, driven by HTTP header.
To define which environment requests will be passed to we have a header with name=“x-cloud-env”
For targets, callouts we set it with value of the variable taken from the global KVM, like:
<AssignMessage async="false" continueOnError="false" enabled="true" name="assign_aws_cloud_headers">
<DisplayName>Assign AWS Headers Into Request</DisplayName>
<Set>
<Headers>
<Header name="x-cloud-env">{flow.cloud-env}</Header>
</Headers>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
For callout we have:
<Request clearPayload="true" variable="flow.ms.request">
<Set>
<Headers>
<Header name="x-cloud-env">{flow.cloud-env}</Header>
</Headers>
<Path>{proxy.pathsuffix}</Path>
</Set>
</Request>
But it does not work for HealthMonitor:
<HealthMonitor>
<IsEnabled>true</IsEnabled>
<IntervalInSec>60</IntervalInSec>
<HTTPMonitor>
<Request>
<ConnectTimeoutInSec>5</ConnectTimeoutInSec>
<SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>
<Port>443</Port>
<Verb>GET</Verb>
<Header name="x-cloud-env">{flow.cloud-env}</Header>
<Path>{flow.healthcheckurl}</Path>
</Request>
<SuccessResponse>
<ResponseCode>200</ResponseCode>
</SuccessResponse>
</HTTPMonitor>
</HealthMonitor>
Is there any possible solution for this? Right now we do some substitution during build, but it is a dirty hack and we’d like to get rid of it