You may receive an Access denied error and there may be some doubt as to which credential is being exactly used. The credential may be sourced from a role ARN, EC2 instance profile, credential profile etc.
You can set the field AwsDebugCreds set to true before getting the token:
signer.AwsDebugCreds = true
the client library will print a debug log of the form:
The log line provides the IAM Account, IAM user id and the ARN of the IAM Principal corresponding to the credential being used.
Please note that the log level should also be set to DEBUG for this information to be logged. It is not recommended to run with AwsDebugCreds=true since it makes an additional remote call.
Getting Help
Please use these community resources for getting help. We use the GitHub issues
for tracking bugs and feature requests.
This repository provides a pluggable library with any Go Kafka client for SASL/OAUTHBEARER mechanism. For more information about SASL/OAUTHBEARER mechanism please go to KIP 255.
Opening Issues
If you encounter a bug with the AWS MSK IAM SASL Signer for Go we would like to hear about it.
Search the existing issues and see
if others are also experiencing the same issue before opening a new issue. Please
include the version of AWS MSK IAM SASL Signer for Go, Go language, and OS you’re using. Please
also include reproduction case when appropriate.
The GitHub issues are intended for bug reports and feature requests. For help
and questions with using AWS MSK IAM SASL Signer for Go, please make use of the resources listed
in the Getting Help section.
Keeping the list of open issues lean will help us respond in a timely manner.
Feedback and contributing
The AWS MSK IAM SASL Signer for Go will use GitHub Issues to track feature requests and issues with the library. In addition, we’ll use GitHub Projects to track large tasks spanning multiple pull requests, such as refactoring the library’s internal request lifecycle. You can provide feedback to us in several ways.
GitHub issues. To provide feedback or report bugs, file GitHub Issues on the library. This is the preferred mechanism to give feedback so that other users can engage in the conversation, +1 issues, etc. Issues you open will be evaluated, and included in our roadmap for the GA launch.
Contributing. You can open pull requests for fixes or additions to the AWS MSK IAM SASL Signer for Go. All pull requests must be submitted under the Apache 2.0 license and will be reviewed by a team member before being merged in. Accompanying unit tests, where possible, are appreciated.
Resources
Service Documentation - Use this
documentation to learn how to interface with AWS MSK.
AWS MSK IAM SASL Signer for Go
aws-msk-iam-sasl-signer-gois the AWS MSK IAM SASL Signer for Go programming language.The AWS MSK IAM SASL Signer for Go requires a minimum version of
Go 1.21.Check out the release notes for information about the latest bug fixes, updates, and features added to the library.
Jump To:
Getting started
To get started working with the AWS MSK IAM SASL Signer for Go with your Kafka client library please follow below code sample -
Add Dependencies
Write Code
For example, you can use the signer library to generate IAM default credentials based OAUTH token with IBM sarama library as below -
Consumer -
To use IAM credentials from a named profile, update the Token() function:
To use IAM credentials by assuming a IAM Role using sts, update the Token() function:
Optionally, if your IAM Role uses an External ID use the following (external-id can be left blank “” and it will be equivalent to the above):
To use IAM credentials from a credentials provider, update the Token() function:
Compile and Execute
Test
Troubleshooting
Finding out which identity is being used
You may receive an
Access deniederror and there may be some doubt as to which credential is being exactly used. The credential may be sourced from a role ARN, EC2 instance profile, credential profile etc. You can set the fieldAwsDebugCredsset to true before getting the token:the client library will print a debug log of the form:
The log line provides the IAM Account, IAM user id and the ARN of the IAM Principal corresponding to the credential being used.
Please note that the log level should also be set to DEBUG for this information to be logged. It is not recommended to run with AwsDebugCreds=true since it makes an additional remote call.
Getting Help
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.
This repository provides a pluggable library with any Go Kafka client for SASL/OAUTHBEARER mechanism. For more information about SASL/OAUTHBEARER mechanism please go to KIP 255.
Opening Issues
If you encounter a bug with the AWS MSK IAM SASL Signer for Go we would like to hear about it. Search the existing issues and see if others are also experiencing the same issue before opening a new issue. Please include the version of AWS MSK IAM SASL Signer for Go, Go language, and OS you’re using. Please also include reproduction case when appropriate.
The GitHub issues are intended for bug reports and feature requests. For help and questions with using AWS MSK IAM SASL Signer for Go, please make use of the resources listed in the Getting Help section. Keeping the list of open issues lean will help us respond in a timely manner.
Feedback and contributing
The AWS MSK IAM SASL Signer for Go will use GitHub Issues to track feature requests and issues with the library. In addition, we’ll use GitHub Projects to track large tasks spanning multiple pull requests, such as refactoring the library’s internal request lifecycle. You can provide feedback to us in several ways.
GitHub issues. To provide feedback or report bugs, file GitHub Issues on the library. This is the preferred mechanism to give feedback so that other users can engage in the conversation, +1 issues, etc. Issues you open will be evaluated, and included in our roadmap for the GA launch.
Contributing. You can open pull requests for fixes or additions to the AWS MSK IAM SASL Signer for Go. All pull requests must be submitted under the Apache 2.0 license and will be reviewed by a team member before being merged in. Accompanying unit tests, where possible, are appreciated.
Resources
Service Documentation - Use this documentation to learn how to interface with AWS MSK.
Issues - Report issues, submit pull requests, and get involved (see Apache 2.0 License)