Service execution role
A Channel assumes a service execution role to deliver data. The role needs a trust policy plus a permission policy that matches your destination type. The following policies are the authoritative reference for the required permissions.
Trust policy
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "kafka.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "ACCOUNT_ID" }, "ArnLike": { "aws:SourceArn": "arn:aws:kafka:REGION:ACCOUNT_ID:channel/*" } } } ] }
Note
Use the aws:SourceArn and aws:SourceAccount conditions to prevent confused deputy attacks.
Permission policy — Amazon S3 general purpose buckets
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DeliveryBucketList", "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3:::BUCKET_NAME", "arn:aws:s3:::BUCKET_NAME/*" ] }, { "Sid": "DeliveryBucketWrite", "Effect": "Allow", "Action": [ "s3:UploadPart", "s3:CompleteMultipartUpload", "s3:CreateMultipartUpload", "s3:PutObject", "s3:ListMultipartUploads", "s3:ListMultipartUploadParts" ], "Resource": [ "arn:aws:s3:::BUCKET_NAME/PREFIX*" ] }, { "Sid": "DLQBucketAccess", "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:PutObject", "s3:ListBucket", "s3:ListBucketMultipartUploads" ], "Resource": [ "arn:aws:s3:::DLQ_BUCKET", "arn:aws:s3:::DLQ_BUCKET/*" ], "Condition": { "StringEquals": { "aws:ResourceAccount": "DLQ_ACCOUNT_ID" } } }, { "Sid": "KMSAccess", "Effect": "Allow", "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": [ "arn:aws:kms:REGION:ACCOUNT_ID:key/KEY_ID" ], "Condition": { "StringEquals": { "kms:ViaService": "s3.REGION.amazonaws.com" }, "StringLike": { "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::BUCKET_NAME/PREFIX*" } } } ] }
Note
The KMSAccess statement is required only when the delivery bucket uses a customer-managed KMS key.
Additional permissions
Amazon CloudWatch Logs (optional): add
logs:CreateLogStreamandlogs:PutLogEventson the log group (see Logging).