How to set Spring datasource url environment property in AWS Beanstalk, if it contains forbidden characters?

huangapple 未分类评论58阅读模式
英文:

How to set Spring datasource url environment property in AWS Beanstalk, if it contains forbidden characters?

问题

我正在将一个Spring Boot应用程序从Azure迁移到AWS Beanstalk。Spring Boot应用程序需要一个spring.datasource.url连接字符串来进行数据库连接。整个连接字符串当前在Azure中进行了设置,并且可以作为环境属性进行访问。连接字符串的格式如下:

jdbc:sqlserver://xyz.database.windows.net:1433;database=developdb;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;

当连接字符串包含像分号这样的禁止字符时,在AWS Beanstalk中如何实现相同的效果?据我所知,分号在Beanstalk配置中不受支持。我既不希望连接字符串成为源代码的一部分,也不希望成为构建结果的一部分。

英文:

I'm migrating a Spring Boot application from Azure to AWS Beanstalk. The Spring Boot application needs a spring.datasource.url connection string for database connection. The whole connection string is currently set in Azure and can be accessed as an environment property. The connection string looks like this jdbc:sqlserver://xyz.database.windows.net:1433;database=developdb;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;

How can I achieve the same in AWS Beanstalk, when the connection string contains forbidden chars like semicolon, which is AFAIK not supported by Beanstalk configuration? I don't want the connection string to be neither part of source code nor build result.

huangapple
  • 本文由 发表于 2020年6月29日 16:53:13
  • 转载请务必保留本文链接:https://java.coder-hub.com/62634514.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定