Restrict S3 bucket access to Identity Pool ID

Viewed 29

I have difficulties to allow access to S3 bucket only to one IdentityPoolId.

I tried such things but it's not working

  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListYourObjects",
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": [
        "arn:aws:s3:::bucket-name"
      ],
      "Condition": {
        "StringLike": {
          "s3:prefix": [
            "cognito/application-name/${cognito-identity.amazonaws.com:sub}/*"
          ]
        }
      }
    }
  ]
}

Do you have an idea ? My IdentityPoolId look like : "us-east-1:XXXXXXX"

Thank you!

0 Answers
Related