Skip to content
v2.276.0

Experimental

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

EncryptionInTransitConfig Struct ​

The settings for encrypting data in transit.

Example ​

ts
import * as acmpca from 'aws-cdk-lib/aws-acmpca';

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.tls({
    certificateAuthorities: [
      acmpca.CertificateAuthority.fromCertificateAuthorityArn(
        this,
        'CertificateAuthority',
        'arn:aws:acm-pca:us-west-2:1234567890:certificate-authority/11111111-1111-1111-1111-111111111111',
      ),
    ],
  }),
});
python
import aws_cdk.aws_acmpca as acmpca

# 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.tls(
        certificate_authorities=[
            acmpca.CertificateAuthority.from_certificate_authority_arn(self, "CertificateAuthority", "arn:aws:acm-pca:us-west-2:1234567890:certificate-authority/11111111-1111-1111-1111-111111111111")
        ]
    )
)
java
import software.amazon.awscdk.services.acmpca.*;

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.tls(TlsAuthProps.builder()
                .certificateAuthorities(List.of(CertificateAuthority.fromCertificateAuthorityArn(this, "CertificateAuthority", "arn:aws:acm-pca:us-west-2:1234567890:certificate-authority/11111111-1111-1111-1111-111111111111")))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MSK.Alpha
using Amazon.CDK.AWS.ACMPCA;

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.Tls(new TlsAuthProps {
        CertificateAuthorities = new [] { CertificateAuthority.FromCertificateAuthorityArn(this, "CertificateAuthority", "arn:aws:acm-pca:us-west-2:1234567890:certificate-authority/11111111-1111-1111-1111-111111111111") }
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkmskalpha/v2
import acmpca "github.com/aws/aws-cdk-go/awscdk"

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_Tls(&TlsAuthProps{
		CertificateAuthorities: []ICertificateAuthority{
			acmpca.CertificateAuthority_FromCertificateAuthorityArn(this, jsii.String("CertificateAuthority"), jsii.String("arn:aws:acm-pca:us-west-2:1234567890:certificate-authority/11111111-1111-1111-1111-111111111111")),
		},
	}),
})

Properties ​

clientBrokeroptionalClientBrokerEncryptionclient_brokeroptionalClientBrokerEncryptionclientBrokeroptionalClientBrokerEncryptionClientBrokeroptionalClientBrokerEncryptionClientBrokeroptionalClientBrokerEncryption= TLS#
Indicates the encryption setting for data in transit between clients and brokers.
enableInClusteroptionalbooleanenable_in_clusteroptionalboolenableInClusteroptionalBooleanEnableInClusteroptionalboolEnableInClusteroptional*bool= true#
Indicates that data communication among the broker nodes of the cluster is encrypted.