Skip to content

msk: add bootstrapBrokersSaslIam #18355

@jfpolly

Description

@jfpolly

Description

Currently @aws-cdk/aws-msk-alpha package supports:

  • bootstrapBrokers
  • bootstrapBrokersTls
  • bootstrapBrokersSaslScram

Please add support for a new property

  • bootstrapBrokersSaslIAM

Use Case

In the case where the Kafka cluster is configured using Sasl with IAM, e.g.:

new msk.Cluster(this, `${tenantName}KafkaCluster`, {
      clusterName: "MyKafkaCluster",
      kafkaVersion: msk.KafkaVersion.V2_8_1,
      vpc: vpc,
      instanceType: new aws_ec2.InstanceType("t3.small"),
      clientAuthentication: msk.ClientAuthentication.sasl({ iam: true })
    });

It is currently not possible to access the bootstrap brokers directly as a property of the Kafka cluster.

Proposed Solution

The Cluster class of aws-msk-alpha contains a private method _bootstrapBrokers. The other public bootstrapBroker* functions are defined in relation to this function:

    get bootstrapBrokers() {
        return this._bootstrapBrokers('BootstrapBrokerString');
    }
// ...
    get bootstrapBrokersTls() {
        return this._bootstrapBrokers('BootstrapBrokerStringTls');
    }
// ...
    get bootstrapBrokersSaslScram() {
        return this._bootstrapBrokers('BootstrapBrokerStringSaslScram');
    }
// ...

A similar function can be defined for SaslIam:

    get bootstrapBrokersSaslIam() {
        return this._bootstrapBrokers('BootstrapBrokerStringSaslIam');
    }

Other information

When accessing the bootstrap brokers of a cluster configured with property

clientAuthentication: msk.ClientAuthentication.sasl({ iam: true })

One can access the bootstrap brokers from the command line:

aws kafka get-bootstrap-brokers --cluster-arn <ClusterArn>

This will return an object:

{
    "BootstrapBrokerStringSaslIam": "..."
}

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-mskRelated to Amazon Managed Streaming for Apache Kafka (Amazon MSK)effort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions