Skip to content

Instantly share code, notes, and snippets.

@ilyesAj
Last active August 19, 2022 14:41
Show Gist options
  • Save ilyesAj/3594cb1f6dd77fa26304890082ca075b to your computer and use it in GitHub Desktop.
Save ilyesAj/3594cb1f6dd77fa26304890082ca075b to your computer and use it in GitHub Desktop.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadBucketA",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::bucket-A",
"arn:aws:s3:::bucket-A/*"
]
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "grantKMSKey",
"Effect": "Allow",
"Action": [
"kms:GenerateDataKey",
"kms:Encrypt",
"kms:DescribeKey",
"kms:Decrypt"
],
"Resource": "arn:aws:kms:eu-west-3:ACCOUNT_B:key/XXXX"
},
{
"Sid": "ReadBucketB",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::bucket-B"
},
{
"Sid": "writeBucketB",
"Effect": "Allow",
"Action": [
"s3:RestoreObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::bucket-B"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment