Skip to content
v2.278.0

Experimental

@aws-cdk/aws-msk-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

SaslAuthProps Struct ​

SASL authentication properties.

Example ​

ts
declare const vpc: ec2.Vpc;
const cluster = new msk.Cluster(this, 'cluster', {
  clusterName: 'myCluster',
  kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
  vpc,
  encryptionInTransit: {
    clientBroker: msk.ClientBrokerEncryption.TLS,
  },
  clientAuthentication: msk.ClientAuthentication.sasl({
    scram: true,
  }),
});
python
# vpc: ec2.Vpc

cluster = msk.Cluster(self, "cluster",
    cluster_name="myCluster",
    kafka_version=msk.KafkaVersion.V4_1_X_KRAFT,
    vpc=vpc,
    encryption_in_transit=msk.EncryptionInTransitConfig(
        client_broker=msk.ClientBrokerEncryption.TLS
    ),
    client_authentication=msk.ClientAuthentication.sasl(
        scram=True
    )
)
java
Vpc vpc;

Cluster cluster = Cluster.Builder.create(this, "cluster")
        .clusterName("myCluster")
        .kafkaVersion(KafkaVersion.V4_1_X_KRAFT)
        .vpc(vpc)
        .encryptionInTransit(EncryptionInTransitConfig.builder()
                .clientBroker(ClientBrokerEncryption.TLS)
                .build())
        .clientAuthentication(ClientAuthentication.sasl(SaslAuthProps.builder()
                .scram(true)
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MSK.Alpha
Vpc vpc;

var cluster = new Cluster(this, "cluster", new ClusterProps {
    ClusterName = "myCluster",
    KafkaVersion = KafkaVersion.V4_1_X_KRAFT,
    Vpc = vpc,
    EncryptionInTransit = new EncryptionInTransitConfig {
        ClientBroker = ClientBrokerEncryption.TLS
    },
    ClientAuthentication = ClientAuthentication.Sasl(new SaslAuthProps {
        Scram = true
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkmskalpha/v2
var vpc Vpc

cluster := msk.NewCluster(this, jsii.String("cluster"), &ClusterProps{
	ClusterName: jsii.String("myCluster"),
	KafkaVersion: msk.KafkaVersion_V4_1_X_KRAFT(),
	Vpc: Vpc,
	EncryptionInTransit: &EncryptionInTransitConfig{
		ClientBroker: msk.ClientBrokerEncryption_TLS,
	},
	ClientAuthentication: msk.ClientAuthentication_Sasl(&SaslAuthProps{
		Scram: jsii.Boolean(true),
	}),
})

Properties ​

iamoptionalbooleaniamoptionalbooliamoptionalBooleanIamoptionalboolIamoptional*bool = false #
Enable IAM access control.
keyoptionalIKeyRefkeyoptionalIKeyRefkeyoptionalIKeyRefKeyoptionalIKeyRefKeyoptionalIKeyRef #
KMS Key to encrypt SASL/SCRAM secrets.

Default: CMK will be created with alias msk/{clusterName}/sasl/scram

You must use a customer master key (CMK) when creating users in secrets manager. You cannot use a Secret with Amazon MSK that uses the default Secrets Manager encryption key.

scramoptionalbooleanscramoptionalboolscramoptionalBooleanScramoptionalboolScramoptional*bool = false #
Enable SASL/SCRAM authentication.