kafka_aws_ec2

package
v0.0.0-...-bf83fb3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 7 Imported by: 0

README

Helper to connect to AWS MSK using IAM EC2 Role credentials

Example IAM Policy to access cluster and create, write and read topics

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kafka-cluster:Connect",
                "kafka-cluster:AlterCluster",
                "kafka-cluster:DescribeCluster"
            ],
            "Resource": "arn:aws:kafka:REGION:ACCOUNT_NUMBER:cluster/CLUSTER_NAME/CLUSTER_ID"
        },
        {
            "Effect": "Allow",
            "Action": [
                "kafka-cluster:DescribeTopic",
                "kafka-cluster:CreateTopic",
                "kafka-cluster:WriteData",
                "kafka-cluster:ReadData"
            ],
            "Resource": "arn:aws:kafka:REGION:ACCOUNT_NUMBER:topic/CLUSTER_NAME/CLUSTER_ID/*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "kafka-cluster:AlterGroup",
                "kafka-cluster:DescribeGroup"
            ],
            "Resource": "arn:aws:kafka:REGION:ACCOUNT_NUMBER:group/CLUSTER_NAME/CLUSTER_ID/*"
        }
    ]
}

Documentation

Index

Constants

View Source
const (
	// Error constants
	ECode080101 = e.Code0801 + "01"
	ECode080102 = e.Code0801 + "02"
)

Variables

This section is empty.

Functions

func NewSASLMechanism

func NewSASLMechanism(c SASLMechanismConfig) (sm sasl.Mechanism, err error)

NewSASLMechanism returns a new SASL mechanism using the ec2 role credentials

Types

type SASLMechanismConfig

type SASLMechanismConfig struct {
	Region string
}

SASLMechanismConfig configuration options for NewSASLMechanism

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL