Example of IAM policy for MSK Connect - Amazon Managed Streaming for Apache Kafka
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Example of IAM policy for MSK Connect

To give a non-admin user full access to all MSK Connect functionality, attach a policy like the following one to the user's IAM role.

JSON
{ "Version": "2012-10-17", "Statement": [ { "Sid": "MSKConnectFullAccess", "Effect": "Allow", "Action": [ "kafkaconnect:CreateConnector", "kafkaconnect:DeleteConnector", "kafkaconnect:DescribeConnector", "kafkaconnect:ListConnectors", "kafkaconnect:UpdateConnector", "kafkaconnect:CreateCustomPlugin", "kafkaconnect:DeleteCustomPlugin", "kafkaconnect:DescribeCustomPlugin", "kafkaconnect:ListCustomPlugins", "kafkaconnect:CreateWorkerConfiguration", "kafkaconnect:DeleteWorkerConfiguration", "kafkaconnect:DescribeWorkerConfiguration", "kafkaconnect:ListWorkerConfigurations" ], "Resource": "*" }, { "Sid": "IAMPassRole", "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws-cn:iam::123456789012:role/MSKConnectServiceRole", "Condition": { "StringEquals": { "iam:PassedToService": "kafkaconnect.amazonaws.com" } } }, { "Sid": "EC2NetworkAccess", "Effect": "Allow", "Action": [ "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:DeleteNetworkInterface", "ec2:DescribeVpcs", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups" ], "Resource": "*" }, { "Sid": "MSKClusterAccess", "Effect": "Allow", "Action": [ "kafka:DescribeCluster", "kafka:DescribeClusterV2", "kafka:GetBootstrapBrokers" ], "Resource": "arn:aws-cn:kafka:us-east-1:123456789012:cluster/myCluster/" }, { "Sid": "MSKLogGroupAccess", "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", "logs:DescribeLogStreams", "logs:DescribeLogGroups" ], "Resource": [ "arn:aws-cn:logs:us-east-1:123456789012:log-group:/aws/msk-connect/*" ] }, { "Sid": "S3PluginAccess", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket", "s3:PutObject" ], "Resource": [ "arn:aws-cn:s3:::amzn-s3-demo-bucket1-custom-plugins", "arn:aws-cn:s3:::amzn-s3-demo-bucket1-custom-plugins/*" ] } ] }