[英]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.