This was one of the main reasons why we decided to use a database. The second reason was that the amount of data was quite big, complex, and really dynamic, meaning that it could change a lot, frequently.
We split this challenge into two groups, configuring automation of the deployment and executing migrations.
- Configuring Automation of the Deployment
This was the first challenge and since we were using a database, we had to configure and keep a database connection open in the application. We were using environment variables to store all the values needed for the database connection for security reasons and flexibility of configuration in all the environments.
We had to think of a way how to replace those environment variables from Gitlab CI in the YAML template file that we were using to represent the deployment through SAM and Cloud Formation. The configuration of this file is as shown below.