Snehashish
Snehashish

Reputation: 74

Deployment of a spring boot application on AWS EB with RDS

New to AWS EB and RDS.

My spring boot app is currently having one profile of datasource to connect to the local mysql. I have initialised the RDS and configured RDS endpoint in my local profile before packaging. Maven packaging fails because it runs test with the production datasource in local.

I could see below solutions to the issue, but not tried.

  1. Should I skip the test phase in maven packaging phase?
  2. Should I build the package with local datasource, and will define db configuration in AWS environment? (Do AWS EB environment variables override spring datasource variables?)
  3. Should I define two profiles for datasource (ex. dev, prod) and on AWS EB environment set the "prod" profile active?

Please advice me with the right approach.

Upvotes: 0

Views: 258

Answers (1)

jarnohenneman
jarnohenneman

Reputation: 1043

  1. Should I skip the test phase in packaging?

My preferences goes toward making your test phase environment independent, so it does not make a different to build for Dev, Test or Prod.

  1. Should I build the package with local datasource, and will define db configuration in AWS environment? (Do AWS EB environment variables override spring datasource variables?)
  2. Should I define two profiles for datasource (ex. dev, prod) and on AWS EB environment set the "prod" profile active?

2 + 3 My preference goes to have packages that are not bound to an environment, and use a tool like Puppet to inject the environment specific configuration during deployment.

Upvotes: 1

Related Questions