当我尝试通过aws cli检查s3存储桶时,我得到:
>>aws s3api get-bucket-acl --bucket my-bucket --profile myProfile
{
"Owner": {
"DisplayName": "....",
"ID": "...."
},
"Grants": [
{
"Grantee": {
"DisplayName": "....",
"ID": "....",
"Type": "CanonicalUser"
},
"Permission": "FULL_CONTROL"
}
]
}
但是当我尝试使用配置文件“ myProfile”的访问密钥和秘密密钥将文件持久存储在存储桶中时,出现错误:
com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: xxx; S3 Extended Request ID: yyy, S3 Extended Request ID: zzz
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1799)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleServiceErrorResponse(AmazonHttpClient.java:1383)
这是一个Spring Boot应用程序,其aws密钥存储在application.properties中。我在Windows 10上。
我在做什么错了?