I have an application that has three Elastic Beanstalk applications for a single app to run.
App 1 - Scala application containing interfaces to be used as a library
App 2 - Scala application containing all business logic and RDS connection using VPC and other security groups as required. It's dependent on App 1
App 3 - Laravel/PHP application containing the frontend/web part of the application and is dependent on App 2
I've been using CI/CD to build dependency out of App 1, build a war file out of App 2 using a pom file from App 1 and deploy the war file to elastic beanstalk. For App 3, I've defined the Private IP of App 2 to access the app as Environment Variable.
For normal deployment, it works fine as all VPC and security groups are defined on configuration.
The problem appears when App 2 environment is rebuilt. It assigns a new IP address. Sometimes the connection gets broken with RDS because of certificates or security group changes.
I'm trying to figure out some way to ease the deployment in my case. Maybe if there's a way to define all configs in JSON file for all applications and with a command in AWS CLI, I could deploy apps sequentially and assign the App credentials to dependent App.
Looking for some help/suggestions