AWS CLIについて学んでいませんでした。ローカルフォルダからS3のバケットにコピーしようとしましたが、次のエラーを返す:バケットポリシーエディタ:ポリシーを有効なJSON文字列として解析できませんでした
upload failed: ./lalala.txt to s3://buecket_name/ An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
だから私はこのことについての検索だと、インターネットはその問題がバケットポリシーエディタであるので、私はポリシーを編集しようと私に語ったが、私はエラーが名前を付けて保存]をクリックしたときに次のとおりです。
Bucket Policy Editor:Policy could not be parsed as a valid JSON string
マイポリシースクリプト:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets"
"Resource": "arn:aws:s3:::bucket-name*"
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::bucket-name"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::bucket-name/*"
}
]
}
_____UPDATE_____:
Policy could not be parsed as a valid JSON string
現在のスクリプト:
を男は下記をお勧めしますが、エラーが続くようだからみんな、私は、 "主" を追加するスクリプトを変更してみてください
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:Sao Paulo:X1X8XX6YYY16X:name-bucket*"
},
"Principal": {
"AWS": [
"arn:aws:iam::AWS-account-ID:root"
]
}
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::bucket-name"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::bucket-name/*"
}
]
}
だから私は間違っていますか?
ありがとうございました!
私はコンマを入れましたが、エラーは次のようになります: '必須フィールドプリンシパルが未定義です' –
@DouglasDiasdaSilva - あなたのS3バケットへのアクセスが許可されている人を示す 'Principal'フィールドを指定する必要があります。詳細は彼の[S3 Documentation](http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-bucket-user-policy-specifying-principal-intro.html)を参照してください。 – birryree