API / APIGEE Gateway Interview Questions
What are Key Value Maps (KVMs) in Apigee and how do you use them?
Key Value Maps (KVMs) are encrypted, persistent key-value stores that allow Apigee proxies to read configuration values at runtime without hardcoding them. KVMs are ideal for storing environment-specific configuration like backend URLs, API keys, feature flags, and whitelists that need to change without redeploying proxies.
| Scope | Accessible from | Use case |
|---|---|---|
| Organisation | All proxies in the org | Global config: OAuth endpoints, universal whitelists |
| Environment | All proxies in that environment | Environment-specific: backend URLs for dev vs prod |
| Proxy | Only that specific proxy | Proxy-specific: feature flags, local config |
<!-- KeyValueMapOperations policy: GET --> <KeyValueMapOperations name="KVM.GetConfig" mapIdentifier="backend-config"> <Scope>environment</Scope> <Get assignTo="backendUrl" index="1"> <Key><Parameter>target.url</Parameter></Key> </Get> </KeyValueMapOperations> <!-- After execution, use the retrieved value --> <!-- {backendUrl} is now available in flow variables --> <!-- KeyValueMapOperations policy: PUT (write a value) --> <KeyValueMapOperations name="KVM.PutToken" mapIdentifier="token-cache"> <Scope>environment</Scope> <Put override="true"> <Key><Parameter>access_token</Parameter></Key> <Value ref="token_response.access_token"/> </Put> </KeyValueMapOperations> <!-- CLI: create a KVM and set values --> # Using Apigee API: # curl -X POST "https://apigee.googleapis.com/v1/organizations/my-org/environments/prod/keyvaluemaps" \ # -d '{"name": "backend-config", "encrypted": true}' # Add an entry: # curl -X POST ".../keyvaluemaps/backend-config/entries" \ # -d '{"name": "target.url", "value": "https://api.prod.internal.com"}'
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
