awss3不能用spring引导上传文件

rslzwgfq  于 2021-07-06  发布在  Java
关注(0)|答案(2)|浏览(328)

当我做一个post请求时,我给出了以下日志。

2020-11-15 16:44:31.568  INFO 22872 --- [nio-8080-exec-5] com.aws.awss3.serviceimpl.AmazonClient   : Caught an AmazonServiceException from GET requests, rejected reasons:
2020-11-15 16:44:31.568  INFO 22872 --- [nio-8080-exec-5] com.aws.awss3.serviceimpl.AmazonClient   : Error Message:    Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID:**********; S3 Extended Request ID: YMIe4OqTzt0f84HP4L8S0mjpuL2RL25bV/mqyK5iX0+M9lKjDdn/Q1sBfjwd2scCu9BOUxoPqkM=; Proxy: null)
2020-11-15 16:44:31.568  INFO 22872 --- [nio-8080-exec-5] com.aws.awss3.serviceimpl.AmazonClient   : HTTP Status Code: 403
2020-11-15 16:44:31.568  INFO 22872 --- [nio-8080-exec-5] com.aws.awss3.serviceimpl.AmazonClient   : AWS Error Code:   AccessDenied
2020-11-15 16:44:31.568  INFO 22872 --- [nio-8080-exec-5] com.aws.awss3.serviceimpl.AmazonClient   : Error Type:       Client
2020-11-15 16:44:31.569  INFO 22872 --- [nio-8080-exec-5] com.aws.awss3.serviceimpl.AmazonClient   : Request ID:       ############
3htmauhk

3htmauhk1#

请检查您的iam角色。应该为您提供s3写访问权限才能继续

bxgwgixi

bxgwgixi2#

我认为这个错误信息是不言自明的。您没有访问/更新s3 bucket的正确权限。检查s3 bucket策略/配置。

相关问题