【发布时间】:2017-07-15 22:15:09
【问题描述】:
我是 AWS 和 Spring Cloud 的新手。我已经完成了一个简单的 AWS Java 应用程序,其中 AWS 凭证存储在 ~/.aws/credentials 文件中。它工作得很好。我搬到了 Spring Boot 和 Spring Cloud 中的一个新项目。我想继续使用我为 Java 应用程序设置的 ~/.aws/credential。但是,我还没有找到从凭证文件中加载凭证的方法。我不得不将访问密钥和密钥移动到 aws-config.xml。
<aws-context:context-credentials>
<aws-context:simple-credentials access-key="${accessKey:}" secret-key="${secretKey:}"/>
<aws-context:context-resource-loader/>
当我完成此操作时,Spring Boot 和 Spring Cloud 应用程序运行良好。但是,将信息保存在 xml 文件中并不是最安全的方式,因为我使用的是 GitHub。
有人可以指出我可以使用 Maven 将信息从 ~/.aws/credentials 文件中提取到 Spring Boot /Spring Cloud 的方向吗?
感谢您花时间阅读我的帖子。
罗斯
【问题讨论】:
-
您是在 AWS(EC2 实例)中运行应用程序本身,还是在 AWS 外部运行并访问 AWS 资源的应用程序?
标签: spring amazon-web-services amazon-s3 spring-boot spring-cloud