Hi I've created a kafka cluster and enabled IAM authentication, I'm running an app in ECS cluster.
I have mapped a role this ECS task and this role has this policy, I can able create topic, delete topics from java client.
But I got below error
org.apache.kafka.common.errors.GroupAuthorizationException: Not authorized to access group: <consumer-group-name>
So I've changed my policy from this
{
"Sid" : "AllowedKafkaPermissions",
"Effect" : "Allow",
"Action" : [
"kafka-cluster:Connect",
"kafka-cluster:ReadData",
"kafka-cluster:CreateTopic",
"kafka-cluster:AlterTopic",
"kafka-cluster:DeleteTopic",
"kafka-cluster:WriteData",
"kafka-cluster:WriteDataIdempotently",
"kafka-cluster:Describe*",
"kafka:Describe*",
"kafka:List*",
"kafka:Get*"
],
"Resource" : [
"arn:aws:kafka:${var.aws_region}:${var.aws_account_id}:topic/${local.kafka_cluster_name}/*/*",
"arn:aws:kafka:${var.aws_region}:${var.aws_account_id}:cluster/${local.kafka_cluster_name}/*",
"arn:aws:kafka:${var.aws_region}:${var.aws_account_id}:group/${local.kafka_cluster_name}/*/*",
]
}
to this
{
"Sid" : "AllowedKafkaPermissions",
"Effect" : "Allow",
"Action" : [
"kafka-cluster:Connect",
"kafka-cluster:AlterCluster",
"kafka-cluster:ReadData",
"kafka-cluster:CreateTopic",
"kafka-cluster:AlterTopic",
"kafka-cluster:DeleteTopic",
"kafka-cluster:WriteData",
"kafka-cluster:WriteDataIdempotently",
"kafka-cluster:Describe*",
"kafka-cluster:AlterTransactionalId",
"kafka:Describe*",
"kafka:List*",
"kafka:Get*"
],
"Resource" : [
"arn:aws:kafka:${var.aws_region}:${var.aws_account_id}:topic/${local.kafka_cluster_name}/*/*",
"arn:aws:kafka:${var.aws_region}:${var.aws_account_id}:cluster/${local.kafka_cluster_name}/*",
"arn:aws:kafka:${var.aws_region}:${var.aws_account_id}:group/${local.kafka_cluster_name}/*/*",
]
}
Still, the issue is not resolved. What should I do to resolve this issue?
Do i need to put a Kafka ACL entry to resolve this issue or it can be handled via IAM policy?
Can someone help me on this..