我使用该选项将 MySQL 数据库凭证存储在 AWS Secret Manager 中Credentials for other database。我想将这些凭据导入到我的application.properties文件中。根据我在该线程中找到的一些答案,我执行了以下操作:
spring-cloud-starter-aws-secrets-manager-configspring.application.name = <application name>和spring.config.import = aws-secretsmanager: <Secret name>在application.propertiesRun Code Online (Sandbox Code Playgroud)spring.datasource.url = jdbc:mysql://${host}:3306/db_name spring.datasource.username=${username} spring.datasource.password=${password}
我在运行应用程序时收到以下错误:
java.lang.IllegalStateException: Unable to load config data from 'aws-secretsmanager:<secret_name>'
Caused by: java.lang.IllegalStateException: File extension is not known to any PropertySourceLoader. If the location is meant to reference a directory, it must end in '/' or File.separator
Run Code Online (Sandbox Code Playgroud)
首先,我遵循的流程正确吗?如果是,此错误与什么有关以及如何解决?
amazon-web-services spring-boot spring-cloud spring-cloud-config aws-secrets-manager