Search code examples
amazon-web-servicesspring-bootcloudcaptain

Connect app to custom db after deployment with boxfuse


I need to use a custom db instead of one that boxfuse creates when deploying my application to aws. I created a aws rds database, and the app won't connect to it after deploying, instead it uses a database that boxfuse creates while deploying. I use flyway for migrations. I tried to put the url, username and password into a configuration boxfuse.yml file, but nothing happens. I read the boxfuse documentation, but couldn't find a solution to my problem. Is there a easy way to solve my problem?


Solution

  • To use your own database and prevent Boxfuse from provisioning one for you, the easiest is to recreate your app with -db.type=none (see https://cloudcaptain.sh/docs/payloads/springboot#databases)

    Alternatively if you want to use both the Boxfuse-provisioned database and your own, you have to manually define a second DataSource bean with the correct connection parameters which you can then pass to Flyway or any other library requiring it.