简体   繁体   English

Spring Boot Application无法在AWS Elastic Beanstalk中进行一次身份验证

[英]Spring Boot Application not authenticating once in AWS Elastic Beanstalk

I have a REST API Spring Boot application for AWS that is being developed. 我有一个正在开发的适用于AWS的REST API Spring Boot应用程序。 It has been developed on a local machine and through that local machine, we have been able to pull down live AWS data even through it was on a local machine and the URL was localhost. 它是在本地计算机上开发的,通过该本地计算机,即使在本地计算机上且URL为本地主机,我们也能够提取实时AWS数据。 We have finished most of development and are ready to move it up to the cloud. 我们已经完成了大部分开发工作,并准备将其迁移到云中。 However, now that we created a JAR, hosted it on AWS Elastic Beanstalk, and call the API URL, AWS now gives us a 500 Access Denied Error. 但是,现在我们创建了一个JAR,将其托管在AWS Elastic Beanstalk上,并调用API URL,AWS现在为我们提供了500 Access Denied Error。

Currently, our local application was being authenticated through variables in the application.properties file of our project. 当前,我们的本地应用程序正在通过我们项目的application.properties文件中的变量进行身份验证。 Those seem to not apply in the cloud environment. 这些似乎不适用于云环境。 We also tried setting the environment variables in the Elastic Beanstalk to the same values that we have in our application.properties but that still returns a 500 error. 我们还尝试将Elastic Beanstalk中的环境变量设置为与application.properties中相同的值,但是仍然返回500错误。

Here is our exact returned error from AWS 这是我们从AWS返回的确切错误

{
    "timestamp": "2019-07-02T20:23:31.400+0000",
    "status": 500,
    "error": "Internal Server Error",
    "message": "Access Denied (Service: S3, Status Code: 403, Request ID: 66CA2FE6CEE7A5D4)",
    "path": "/api/s3/buckets/list"
}

And here is the application.properties file where I placed the security keys 这是我放置安全密钥的application.properties文件

cloud.aws.credentials.accessKey=XXXXXXXXXXXXX
cloud.aws.credentials.secretKey=XXXXXXXXXXXXXXX
cloud.aws.region.static=us-east-1

I think Elastic Beanstalk might not have read/write role through which it can access S3. 我认为Elastic Beanstalk可能没有读取/写入角色,因此它无法访问S3。 You won't need credentials when running in AWS, everything depends on roles (permissions) 在AWS中运行时,您不需要凭证,一切都取决于角色(权限)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将Spring Boot应用程序大战部署到AWS Elastic Beanstalk? - How to deploy Spring Boot application war to AWS Elastic Beanstalk? AWS Elastic Beanstalk-Tomcat Java Spring Boot应用程序出现问题 - AWS Elastic Beanstalk - Problem with tomcat java spring boot application 使用自动 SSL 证书在 AWS Elastic Beanstalk 上部署 Spring Boot 应用程序 - Deploy Spring Boot application on AWS Elastic Beanstalk with automatic SSL certificates 使用Elastic BeansTalk CLI部署Spring Boot应用程序 - Deploy Spring Boot application with Elastic BeansTalk CLI AWS Elastic Beanstalk(单实例):如何为 Spring 启动应用程序启用 HTTPS? - AWS Elastic Beanstalk (single instance) : how to enable HTTPS for a Spring Boot application? 如何在 Tomcat AWS Elastic beanstalk (Spring Boot Application) 中修改或添加新的 Nginx 配置 - How to modify or add new Nginx configuration in Tomcat AWS Elastic beanstalk (Spring Boot Application) aws 弹性 beantalk 上的 HTTP 到 HTTPS 不适用于 Spring Boot - HTTP to HTTPS on aws elastic beanstalk not working for Spring Boot AWS Elastic Beanstalk上的Spring Boot / Tomcat仅显示404页面 - Spring Boot / Tomcat on AWS Elastic Beanstalk only showing 404 page 在AWS Elastic Beanstalk上部署Spring Boot应用程序 - 获得502错误 - Deploying Spring Boot app on AWS Elastic Beanstalk — getting 502 error 将Spring Boot应用程序部署到Elastic Beanstalk时出现502 Bad Gateway - 502 Bad Gateway when deploying Spring Boot application to Elastic Beanstalk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM