Correct S3 Policy For Pre-Signed URLs

后端 未结 4 520
再見小時候
再見小時候 2021-01-01 19:46

I need to issue pre-signed URLs for allowing users to GET and PUT files into a specific S3 bucket. I created an IAM user and use its keys to create the pre-signed URLs, and

4条回答
  •  既然无缘
    2021-01-01 20:33

    Here is an IAM policy that works for my presigned S3 URLs.

    {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::mydocs/*"
          }
        ]
    }
    

    I wonder if your problem is in the Resource part. Were your GET requests for bucket MyBucket always?

提交回复
热议问题