Skip to content

Commit a1226db

Browse files
authored
feat(msk): support Kafka versions 3.9.x and 3.9.x Kraft (#34213)
### Issue # (if applicable) N/A ### Reason for this change MSK supports Apache Kafka version 3.9. Ref: https://aws.amazon.com/about-aws/whats-new/2025/04/amazon-msk-apache-kafka-version-3-9/ ### Description of changes Add 3.9.x version. ### Describe any new or updated permissions being added N/A ### Description of how you validated changes Add unit tests and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 59c8c7d commit a1226db

11 files changed

+231
-3210
lines changed

packages/@aws-cdk/aws-msk-alpha/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following example creates an MSK Cluster.
2323
declare const vpc: ec2.Vpc;
2424
const cluster = new msk.Cluster(this, 'Cluster', {
2525
clusterName: 'myCluster',
26-
kafkaVersion: msk.KafkaVersion.V3_8_X,
26+
kafkaVersion: msk.KafkaVersion.V3_9_X,
2727
vpc,
2828
});
2929
```
@@ -36,7 +36,7 @@ To control who can access the Cluster, use the `.connections` attribute. For a l
3636
declare const vpc: ec2.Vpc;
3737
const cluster = new msk.Cluster(this, 'Cluster', {
3838
clusterName: 'myCluster',
39-
kafkaVersion: msk.KafkaVersion.V3_8_X,
39+
kafkaVersion: msk.KafkaVersion.V3_9_X,
4040
vpc,
4141
});
4242

@@ -88,7 +88,7 @@ import * as acmpca from 'aws-cdk-lib/aws-acmpca';
8888
declare const vpc: ec2.Vpc;
8989
const cluster = new msk.Cluster(this, 'Cluster', {
9090
clusterName: 'myCluster',
91-
kafkaVersion: msk.KafkaVersion.V3_8_X,
91+
kafkaVersion: msk.KafkaVersion.V3_9_X,
9292
vpc,
9393
encryptionInTransit: {
9494
clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -113,7 +113,7 @@ Enable client authentication with [SASL/SCRAM](https://docs.aws.amazon.com/msk/l
113113
declare const vpc: ec2.Vpc;
114114
const cluster = new msk.Cluster(this, 'cluster', {
115115
clusterName: 'myCluster',
116-
kafkaVersion: msk.KafkaVersion.V3_8_X,
116+
kafkaVersion: msk.KafkaVersion.V3_9_X,
117117
vpc,
118118
encryptionInTransit: {
119119
clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -132,7 +132,7 @@ Enable client authentication with [IAM](https://docs.aws.amazon.com/msk/latest/d
132132
declare const vpc: ec2.Vpc;
133133
const cluster = new msk.Cluster(this, 'cluster', {
134134
clusterName: 'myCluster',
135-
kafkaVersion: msk.KafkaVersion.V3_8_X,
135+
kafkaVersion: msk.KafkaVersion.V3_9_X,
136136
vpc,
137137
encryptionInTransit: {
138138
clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -155,7 +155,7 @@ import * as acmpca from 'aws-cdk-lib/aws-acmpca';
155155
declare const vpc: ec2.Vpc;
156156
const cluster = new msk.Cluster(this, 'Cluster', {
157157
clusterName: 'myCluster',
158-
kafkaVersion: msk.KafkaVersion.V3_8_X,
158+
kafkaVersion: msk.KafkaVersion.V3_9_X,
159159
vpc,
160160
encryptionInTransit: {
161161
clientBroker: msk.ClientBrokerEncryption.TLS,
@@ -186,7 +186,7 @@ declare const vpc: ec2.Vpc;
186186
declare const bucket: s3.IBucket;
187187
const cluster = new msk.Cluster(this, 'cluster', {
188188
clusterName: 'myCluster',
189-
kafkaVersion: msk.KafkaVersion.V3_8_X,
189+
kafkaVersion: msk.KafkaVersion.V3_9_X,
190190
vpc,
191191
logging: {
192192
s3: {
@@ -226,7 +226,7 @@ declare const bucket: s3.IBucket;
226226

227227
const cluster = new msk.Cluster(this, 'cluster', {
228228
clusterName: 'myCluster',
229-
kafkaVersion: msk.KafkaVersion.V3_6_0,
229+
kafkaVersion: msk.KafkaVersion.V3_9_X,
230230
vpc,
231231
storageMode: msk.StorageMode.TIERED,
232232
});

packages/@aws-cdk/aws-msk-alpha/lib/cluster-version.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,20 @@ export class KafkaVersion {
210210
* @see https://docs.aws.amazon.com/msk/latest/developerguide/metadata-management.html#kraft-intro
211211
*/
212212
public static readonly V3_8_X_KRAFT = KafkaVersion.of('3.8.x.kraft', { tieredStorage: true });
213+
214+
/**
215+
* Kafka version 3.9.x with ZooKeeper metadata mode support
216+
*
217+
* @see https://docs.aws.amazon.com/msk/latest/developerguide/metadata-management.html#msk-get-connection-string
218+
*/
219+
public static readonly V3_9_X = KafkaVersion.of('3.9.x', { tieredStorage: true });
220+
221+
/**
222+
* Kafka version 3.9.x with KRaft (Apache Kafka Raft) metadata mode support
223+
*
224+
* @see https://docs.aws.amazon.com/msk/latest/developerguide/metadata-management.html#kraft-intro
225+
*/
226+
public static readonly V3_9_X_KRAFT = KafkaVersion.of('3.9.x.kraft', { tieredStorage: true });
213227
/**
214228
* Custom cluster version
215229
* @param version custom version number

packages/@aws-cdk/aws-msk-alpha/test/cluster.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ describe('MSK Cluster', () => {
4949
[msk.KafkaVersion.V3_7_X_KRAFT, '3.7.x.kraft'],
5050
[msk.KafkaVersion.V3_8_X, '3.8.x'],
5151
[msk.KafkaVersion.V3_8_X_KRAFT, '3.8.x.kraft'],
52+
[msk.KafkaVersion.V3_9_X, '3.9.x'],
53+
[msk.KafkaVersion.V3_9_X_KRAFT, '3.9.x.kraft'],
5254
],
5355
)('created with expected Kafka version %j', (parameter, result) => {
5456
new msk.Cluster(stack, 'Cluster', {
@@ -978,4 +980,3 @@ describe('MSK Cluster', () => {
978980
});
979981
});
980982
});
981-

packages/@aws-cdk/aws-msk-alpha/test/integ.cluster-version.js.snapshot/KafkaVersionIntegTestDefaultTestDeployAssertD6628743.assets.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-msk-alpha/test/integ.cluster-version.js.snapshot/KafkaVersionTestStack.assets.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-msk-alpha/test/integ.cluster-version.js.snapshot/KafkaVersionTestStack.template.json

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,144 @@
18391839
},
18401840
"UpdateReplacePolicy": "Delete",
18411841
"DeletionPolicy": "Delete"
1842+
},
1843+
"ClusterVersion39xSecurityGroupEEB562CB": {
1844+
"Type": "AWS::EC2::SecurityGroup",
1845+
"Properties": {
1846+
"GroupDescription": "MSK security group",
1847+
"SecurityGroupEgress": [
1848+
{
1849+
"CidrIp": "0.0.0.0/0",
1850+
"Description": "Allow all outbound traffic by default",
1851+
"IpProtocol": "-1"
1852+
}
1853+
],
1854+
"VpcId": {
1855+
"Ref": "Vpc8378EB38"
1856+
}
1857+
}
1858+
},
1859+
"ClusterVersion39x27DE3BBA": {
1860+
"Type": "AWS::MSK::Cluster",
1861+
"Properties": {
1862+
"BrokerNodeGroupInfo": {
1863+
"ClientSubnets": [
1864+
{
1865+
"Ref": "VpcPrivateSubnet1Subnet536B997A"
1866+
},
1867+
{
1868+
"Ref": "VpcPrivateSubnet2Subnet3788AAA1"
1869+
}
1870+
],
1871+
"InstanceType": "kafka.m5.large",
1872+
"SecurityGroups": [
1873+
{
1874+
"Fn::GetAtt": [
1875+
"ClusterVersion39xSecurityGroupEEB562CB",
1876+
"GroupId"
1877+
]
1878+
}
1879+
],
1880+
"StorageInfo": {
1881+
"EBSStorageInfo": {
1882+
"VolumeSize": 1000
1883+
}
1884+
}
1885+
},
1886+
"ClusterName": "cluster-v3-9-x",
1887+
"EncryptionInfo": {
1888+
"EncryptionInTransit": {
1889+
"ClientBroker": "TLS",
1890+
"InCluster": true
1891+
}
1892+
},
1893+
"KafkaVersion": "3.9.x",
1894+
"LoggingInfo": {
1895+
"BrokerLogs": {
1896+
"CloudWatchLogs": {
1897+
"Enabled": false
1898+
},
1899+
"Firehose": {
1900+
"Enabled": false
1901+
},
1902+
"S3": {
1903+
"Enabled": false
1904+
}
1905+
}
1906+
},
1907+
"NumberOfBrokerNodes": 2
1908+
},
1909+
"UpdateReplacePolicy": "Delete",
1910+
"DeletionPolicy": "Delete"
1911+
},
1912+
"ClusterVersion39xkraftSecurityGroupA2700FB1": {
1913+
"Type": "AWS::EC2::SecurityGroup",
1914+
"Properties": {
1915+
"GroupDescription": "MSK security group",
1916+
"SecurityGroupEgress": [
1917+
{
1918+
"CidrIp": "0.0.0.0/0",
1919+
"Description": "Allow all outbound traffic by default",
1920+
"IpProtocol": "-1"
1921+
}
1922+
],
1923+
"VpcId": {
1924+
"Ref": "Vpc8378EB38"
1925+
}
1926+
}
1927+
},
1928+
"ClusterVersion39xkraft96CD852C": {
1929+
"Type": "AWS::MSK::Cluster",
1930+
"Properties": {
1931+
"BrokerNodeGroupInfo": {
1932+
"ClientSubnets": [
1933+
{
1934+
"Ref": "VpcPrivateSubnet1Subnet536B997A"
1935+
},
1936+
{
1937+
"Ref": "VpcPrivateSubnet2Subnet3788AAA1"
1938+
}
1939+
],
1940+
"InstanceType": "kafka.m5.large",
1941+
"SecurityGroups": [
1942+
{
1943+
"Fn::GetAtt": [
1944+
"ClusterVersion39xkraftSecurityGroupA2700FB1",
1945+
"GroupId"
1946+
]
1947+
}
1948+
],
1949+
"StorageInfo": {
1950+
"EBSStorageInfo": {
1951+
"VolumeSize": 1000
1952+
}
1953+
}
1954+
},
1955+
"ClusterName": "cluster-v3-9-x-kraft",
1956+
"EncryptionInfo": {
1957+
"EncryptionInTransit": {
1958+
"ClientBroker": "TLS",
1959+
"InCluster": true
1960+
}
1961+
},
1962+
"KafkaVersion": "3.9.x.kraft",
1963+
"LoggingInfo": {
1964+
"BrokerLogs": {
1965+
"CloudWatchLogs": {
1966+
"Enabled": false
1967+
},
1968+
"Firehose": {
1969+
"Enabled": false
1970+
},
1971+
"S3": {
1972+
"Enabled": false
1973+
}
1974+
}
1975+
},
1976+
"NumberOfBrokerNodes": 2
1977+
},
1978+
"UpdateReplacePolicy": "Delete",
1979+
"DeletionPolicy": "Delete"
18421980
}
18431981
},
18441982
"Parameters": {

packages/@aws-cdk/aws-msk-alpha/test/integ.cluster-version.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-msk-alpha/test/integ.cluster-version.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-msk-alpha/test/integ.cluster-version.js.snapshot/manifest.json

Lines changed: 58 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)