Key Value Map Synch between environment

I have a scenario where two production environment (running in different regions for high availability) are grouped into a single group. However, I have key value maps defined independently in each environment. So I have two questions:

1) Is there a better practice to handle this scenario. I do understand the KVM scoping could be used (proxy. environment, organization) but only my production org has two different environment. My DEV and QA are under single org and have only one environment for each. I want to run DEV and QA independently. 

2) Is there a way that KVM could be synchronized between environment? 

Thanks for help in advance.

Athar

1 1 104
1 REPLY 1

1) In this scenario, I would create an organization scoped KVM. You can then create an entry that aligns to the appropriate environment. For example -

[
    {
        "name": "dev__config1",
        "value": "foo"
    },
    {
        "name": "qa__config1",
        "value": "bar"
    }
]

This example assumes you want differing values for each environment. That may or may not be your use case.

Then when you use the KeyValueMap policy with the GET operation, you can do this:

<Key>
  <Parameter ref="environment.name"/>
  <Parameter>config1</Parameter>
</Key>

2) There is no built-in way to synchronization the KVMs. Each KVM is separate and distinct; allow you can write the same values to multiple KVMs.