I am creating a NodeJS Hosted Target that will handle message transformation and communication with an internal server. This internal server is already configured as a Target Server, and other services use this Target Server, so I can't yet remove the Target Server, and I'd like to avoid duplicating the Target Server details in a KVM, just for the Hosted Target.
Is it possible to either populate the app.yaml file from the detail of a Hosted Target, or otherwise problematically set environment variables for the Hosted Target based on it's values?
Hey Joseph,
I'm not sure what you mean by "Is it possible to either populate the app.yaml file from the detail of a Hosted Target". Could you elaborate a bit more on what you want to know about formatting the app.yaml? You are able to configure any environment variable (kvm or not) in your app.yaml through the "env" field if that's what you want to know? For instance:
runtime: node env: - name: DB_ENV value: production
As far as dynamically configuring environment variables goes, they are configured in the Hosted Target at deploy time, so it is not possible to dynamically update a Hosted Target's environment variables. If you would like to pass in information dynamically, we recommend passing this information to your Hosted Target through request headers set in the PreFlow section of your proxy.
I mis-typed that part of the question, actually. I should have asked:
> Is it possible to either populate the app.yaml file with the detail of available Target Servers, or otherwise problematically set environment variables for the Hosted Target based on available Target Servers?
What I’m trying to do is create a NodeJS Hosted Target that communicates with servers which are already setup as Target Servers. These Target servers have different hosts for each environment, and are being used by other proxies. I could populate a KVM with the same detail, but if I could somehow avoid duplicating that detail in a KVM, that would be great.
Based on your response, and my research, I think that my options are:
Let me know if you think I’m missing something obvious!
Ah gotcha, that makes more sense. Unfortunately we don't have any constructs in the app.yaml to specify target servers and there is no tooling around dynamically changing an app.yaml at deploy time or otherwise. I think your best bet would be the second point you have there, which would basically reach out to the MGMT server and cache the target servers at the startup of your node code.
Thought so - thanks!
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |