Hosted Target

Hi,

I would like to know what is the best way to make a hosted target environment aware? Thus When the Hosted target run in Dev, QA and PROD it should use associated variables per environment. Almost like a KVM

So I have the following ideas:

1. I know that you can add environmental variables to the app.yaml file. If possible can a example be shared on how to configure a unique x-api-key per environment which will be used in the Hosted Target. I know that you can also add KVM values into the app.yaml values on deployment of the API. Also have not yet got that working.

2. I can use a KVM in the base proxy and pass the variables to the hosted target in headers. Not sure if there is any issue in doing it this way? If number 1 is possible then which one would be preferred

3. Deploy each environment version in its own revision. This is not ideal and can version control issues.

Any other suggestions or ideas?

0 1 262
1 REPLY 1

  1. We already add environment variables to your Hosted Target so that it's environment aware. For setting a specific API Key per environment, you would use the appropriate policy (not HT specific) to do this.
  2. Yes. KVM usage in app.yaml is useful but it's intended for configuration and startup items, as in things that don't change at runtime. If these things will change at runtime, the values should be put into headers using the typical policies (again, not HT specific).
  3. Each environment can be running its own version of the proxy. I don't understand this.