Closed yortch closed 3 years ago
@yortch IAM access control should work with IAM Roles for Service Accounts, though I have not tested that scenario myself. Could you help answer these questions:
Thank you for responding. This issue turned out to be an issue caused by the AWS boundary policy being used. Since the kafka-cluster:*
permissions were introduced back in May, they were not added in the AWS account's boundary policy. After they were added, we were able to successfully connect to MSK via IAM using IRSA. For reference here are the answers to your questions:
<dependency>
<groupId>software.amazon.msk</groupId>
<artifactId>aws-msk-iam-auth</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sts</artifactId>
<version>1.12.28</version>
</dependency>
security.protocol=SASL_SSL
sasl.mechanism=AWS_MSK_IAM
sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule required;
sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler
We are leveraging IRSA (IAM Roles for Service Accounts - https://docs.aws.amazon.com/eks/latest/userguide/create-service-account-iam-policy-and-role.html) feature to connect from Red Hat OpenShift cluster, which is effectively a Kubernetes cluster. We have been able to connect to ASK MSK cluster using PLAINTEXT and TLS. We are now attempting to connect to MSK using IAM Access Control. We have configured our role, policy and required properties (as documented here: https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html), however we have been unable to connect and are getting the "access denied" error below. Here is a snippet of the relevant error. We would like to confirm that this library is compatible with "IRSA":
Thanks in advanced, Jorge