KVM - Dynamically set Map Identifier Name from a variable in KVM Policy

@seanwilliams

I need to set Map Identifier name to a variable in KVM. It doesn't seem to be working for me.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true"
    name="KVM.EncryptedDataStore.GetValueByKey"
    mapIdentifier="{kvm.encryptedDataStore}">
  <DisplayName>KVM - EncryptedDataStore - GetValueByKey</DisplayName>
  <ExpiryTimeInSecs>60</ExpiryTimeInSecs>
  <Get assignTo="KVM.encryptedDS.keyValue" index="1">
    <Key> <Parameter ref="kvm.dataStoreKey"></Parameter> </Key>
  </Get>
  <Scope>environment</Scope>
</KeyValueMapOperations>

Is it possible in Apigee? Any Alternative?

0 9 1,279
9 REPLIES 9

Nope, not possible, as far as I know. Can you explain what you want to do, and how that leads you to desire to use a different KVM map Identifier?

We are using Apigee Vault to keep passwords. Since it is being deprecated, I am trying to use Encypted KVM to do the same. I have created couple of KVMs that will keep passwords.

The approach is to keep password KVM name and Key Name in another KVM that keeps proxy level configuration. Then use that to read password from speciifed KVM.

@Surabhi.gupta

Here is one approach I can suggest.

Create a single KVM named "CredentialsKVM" and then give key names like app1.key1, app1.key2, app2.key1 sth like this. This will solve the problem of dynamically putting the map identifier and you can easily use variables for Keys.

Hope this helps.

it's a good approach but what I am trying to achieve is changing KVM name based on which KVM the proxy is using to keep credentials. There is option to add multiple KVM policies one for each KVM and then based on variable value execute one of the policies using step/condition. but it's not as clean as, be able to dynamically change the map identifier.

what I am trying to achieve is changing KVM name based on which KVM the proxy is using to keep credentials.

ok, that is clear, but why?

??

It seems like you are forcing yourself to do lots of extra unnecessary work.

<MapName> element will dynamically take name

This works in Apigee X and hybrid. (Not sure about Edge )

Hi.
You can skip the mapIdentifier attribute and use <MapName> tag instead. Refer to the link for more details: 

But not supported in external apigee(Google SAAS product).

Working in onprem apigee.