does MAVEN Plugin supports replacing KVM content using config file

We have an Encrypted KVM for which data needs to be read from Org's Key Management Vault. For Proxy and policies we are using config.json to replace content at the run time, do we have any such facility for config module as well, would be good if something is present please provide link to information space like some document or web page.

0 3 187
3 REPLIES 3

@Gaurav Bansal - Yes the config plugin supports a folder based config and file based as well. Please check out the samples in the GitHub repo. By default it picks the edge.json in the same directory as the pom.xml. If your json file is in a different directory then you can pass the path of that file using the -Dapigee.config.file argument. All the details are available in the README guide.

Thanks for your input, I am aware of use of config file, my question was probably not very clear.

For API Proxy, Policies I am already using config.json file to replace content during deployment based on Environment. Things like end point URL, parameters for policies etc.

My use case is following

We need to store something in Encrypted KVM and data being confidential the idea was not to put that in repository, hence what we are trying to achieve is during deployment first we fetch that information from our vault system and then replace that into the deployment packet. IF the same was to be done with some policy parameter we would have put it in config.json as per environment and would have got it replaced during deployment.

But we need to do this in a KVM definition file so wanted to know if there is any config.json content replacement concept there or we will have to explicitly update two locations with some sort of hard coding in Deploy module to determine the location and replace the content for both files. (As we declare KVM data in two files in the proxy setup currently)

I hope my question is clear this time, still will go through the attached link to document to get more insight.

Thanks again for the inputs and directions

Its clear now @Gaurav Bansal

The plugin does not have such capability (or nor will it include). You could probably use the Maven replacer plugin where you can pass the files/token to replace the content of the kvms.json with the actual vault file contents before calling the kvm goal. For more options provided by that plugin, check out its Wiki