Keep your cloud environment secure |
Services for your Cloud Foundry app
Service management is built into Cloud Foundry. You can search for them and obtain details about plans and prices, then provision them and combine them with apps in different ways. A common scenario is to bind them to an app. During the bind process, the service broker obtains a set of credentials and shares them with the application environment. During runtime, apps can then discover those credentials and connect to that service instance.Even if the service is from outside the Cloud Foundry environment (and the IBM Cloud), Cloud Foundry has a neat feature to integrate with it. I wrote about user-provided-services (and Db2) a long time ago.
Rotate the credentials
To update, i.e., to rotate passwords or API keys, simply unbind and then bind again the service to the app. Then, the app needs to be either restaged or restarted. This is needed so that the new environment variables are picked up. Typically, restaging an app would involve a short downtime. The good news is that there are zero downtime plugins for the Cloud Foundry CLI that keep the app available. Moreover, new zero downtime (ZDT) commands are available as early beta and as part of the IBM Cloud CLI for Cloud Foundry.I tested rotation of credentials for one of my apps with the new v3-zdt-restart command. The process was:
- ibmcloud cf unbind-service MY_APP MY_SERVICE_INSTANCE
- ibmcloud cf bind-service MY_APP MY_SERVICE_INSTANCE
- ibmcloud cf v3-zdt-restart MY_APP