keyword: PropertyPlaceholder It seems that you can do various things, but this time I want to use the environment variables set on the server after deploying. It's easy to write. Rewrite as below and you're done.
spring.datasource.url=jdbc:mysql://localhost:3306/test
↓
spring.datasource.url=jdbc:mysql://${RDS_DB_HOST}:${RDS_DB_PORT}/${RDS_DB_NAME}
When running from Eclipse, either VM arguments
or Programe arguments
seems to be okay.
VM_arguments
-DRDS_DB_HOST=localhost
-DRDS_DB_PORT=3306
-DRDS_DB_NAME=test
Programe_arguments
--RDS_DB_HOST=localhost
--RDS_DB_PORT=3306
--RDS_DB_NAME=test