Y.Ynot
Y.Ynot

Reputation: 417

How to solve conditions do not apply to combination of actions and resources in statement?

I am trying to copy an s3 bucket from one account to another account. In order to do so, I am following the steps as described by aws. In step 4, the following policy is suggested:

{
 "Statement": [
        {
          "Sid": "ExampleStmt",
          "Action": [
            "s3:ListBucket",
            "s3:PutObject",
            "s3:PutObjectAcl"
          ],
          "Effect": "Allow",
          "Resource": [
            "arn:aws:s3:::destination-DOC-EXAMPLE-BUCKET",
            "arn:aws:s3:::destination-DOC-EXAMPLE-BUCKET/*"
          ],
          "Condition": {
            "StringEquals": {
              "s3:x-amz-acl": "bucket-owner-full-control"
            }
          },
          "Principal": {
            "AWS": [
              "arn:aws:iam::222222222222:user/Jane"
            ]
          }
        }
      ]
}

However, when I try to do this (after replacing the example buckets and arn), I get the following error: Conditions do not apply to combination of actions and resources in statement.

How can I solve this error and make sure I can copy the s3 from one account to another?

Upvotes: 1

Views: 1588

Answers (1)

samtoddler
samtoddler

Reputation: 9655

The condition key you are using is not applicable to the actions you have specified.

PutObject

PubObjectAcl

ListBucket

You can checkout here Condition keys for Amazon S3 for various conditions being supported by S3.

Upvotes: 1

Related Questions