Skip to content

Commit

Permalink
feat(msk): support for Kafka version 3.8.x and add deprecated labels …
Browse files Browse the repository at this point in the history
…to legacy versions (#33553)

### Issue # (if applicable)

N/A

### Reason for this change
* MSK now supports Kafka version 3.8 ([Ref](https://aws.amazon.com/about-aws/whats-new/2025/02/amazon-msk-apache-kafka-version-3-8/))
* Some versions are already deprecated ([Ref](https://docs.aws.amazon.com/msk/latest/developerguide/supported-kafka-versions.html) 




### Description of changes
* Add Kafka version 3.8.x.
* Add deprecated labels to following versions:

| version | EOL |
|----------|-----|
| 2.6.0 | 2024-09-11 |
| 2.6.1 | 2024-09-11 |
| 2.6.2 | 2024-09-11 |
| 2.6.3 | 2024-09-11 |
| 2.7.0 | 2024-09-11 |
| 2.7.1 | 2024-09-11 |
| 2.7.2 | 2024-09-11 |
| 2.8.0 | 2024-09-11 |
| 2.8.1 | 2024-09-11 |
| 2.8.2-tiered | 2025-01-14 |
| 3.1.1 | 2024-09-11 |
| 3.2.0 | 2024-09-11 |
| 3.3.1 | 2024-09-11 |
| 3.3.2 | 2024-09-11 |



### Describe any new or updated permissions being added
Nothing.



### Description of how you validated changes
Update 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*
  • Loading branch information
mazyu36 authored Feb 24, 2025
1 parent ff658ba commit 29623d1
Show file tree
Hide file tree
Showing 11 changed files with 1,271 additions and 140 deletions.
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-msk-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following example creates an MSK Cluster.
declare const vpc: ec2.Vpc;
const cluster = new msk.Cluster(this, 'Cluster', {
clusterName: 'myCluster',
kafkaVersion: msk.KafkaVersion.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
});
```
Expand All @@ -36,7 +36,7 @@ To control who can access the Cluster, use the `.connections` attribute. For a l
declare const vpc: ec2.Vpc;
const cluster = new msk.Cluster(this, 'Cluster', {
clusterName: 'myCluster',
kafkaVersion: msk.KafkaVersion.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
});

Expand Down Expand Up @@ -88,7 +88,7 @@ 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.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
encryptionInTransit: {
clientBroker: msk.ClientBrokerEncryption.TLS,
Expand All @@ -113,7 +113,7 @@ Enable client authentication with [SASL/SCRAM](https://docs.aws.amazon.com/msk/l
declare const vpc: ec2.Vpc;
const cluster = new msk.Cluster(this, 'cluster', {
clusterName: 'myCluster',
kafkaVersion: msk.KafkaVersion.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
encryptionInTransit: {
clientBroker: msk.ClientBrokerEncryption.TLS,
Expand All @@ -132,7 +132,7 @@ Enable client authentication with [IAM](https://docs.aws.amazon.com/msk/latest/d
declare const vpc: ec2.Vpc;
const cluster = new msk.Cluster(this, 'cluster', {
clusterName: 'myCluster',
kafkaVersion: msk.KafkaVersion.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
encryptionInTransit: {
clientBroker: msk.ClientBrokerEncryption.TLS,
Expand All @@ -155,7 +155,7 @@ 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.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
encryptionInTransit: {
clientBroker: msk.ClientBrokerEncryption.TLS,
Expand Down Expand Up @@ -186,7 +186,7 @@ declare const vpc: ec2.Vpc;
declare const bucket: s3.IBucket;
const cluster = new msk.Cluster(this, 'cluster', {
clusterName: 'myCluster',
kafkaVersion: msk.KafkaVersion.V2_8_1,
kafkaVersion: msk.KafkaVersion.V3_8_X,
vpc,
logging: {
s3: {
Expand Down
41 changes: 41 additions & 0 deletions packages/@aws-cdk/aws-msk-alpha/lib/cluster-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,71 +72,99 @@ export class KafkaVersion {

/**
* Kafka version 2.6.0
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_6_0 = KafkaVersion.of('2.6.0');

/**
* Kafka version 2.6.1
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_6_1 = KafkaVersion.of('2.6.1');

/**
* Kafka version 2.6.2
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_6_2 = KafkaVersion.of('2.6.2');

/**
* Kafka version 2.6.3
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_6_3 = KafkaVersion.of('2.6.3');

/**
* Kafka version 2.7.0
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_7_0 = KafkaVersion.of('2.7.0');

/**
* Kafka version 2.7.1
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_7_1 = KafkaVersion.of('2.7.1');

/**
* Kafka version 2.7.2
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_7_2 = KafkaVersion.of('2.7.2');

/**
* Kafka version 2.8.0
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_8_0 = KafkaVersion.of('2.8.0');

/**
* Kafka version 2.8.1
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_8_1 = KafkaVersion.of('2.8.1');

/**
* AWS MSK Kafka version 2.8.2.tiered
*
* @deprecated use the latest runtime instead
*/
public static readonly V2_8_2_TIERED = KafkaVersion.of('2.8.2.tiered', { tieredStorage: true });

/**
* Kafka version 3.1.1
*
* @deprecated use the latest runtime instead
*/
public static readonly V3_1_1 = KafkaVersion.of('3.1.1');

/**
* Kafka version 3.2.0
*
* @deprecated use the latest runtime instead
*/
public static readonly V3_2_0 = KafkaVersion.of('3.2.0');

/**
* Kafka version 3.3.1
*
* @deprecated use the latest runtime instead
*/
public static readonly V3_3_1 = KafkaVersion.of('3.3.1');

/**
* Kafka version 3.3.2
*
* @deprecated use the latest runtime instead
*/
public static readonly V3_3_2 = KafkaVersion.of('3.3.2');

Expand Down Expand Up @@ -169,6 +197,19 @@ export class KafkaVersion {
*/
public static readonly V3_7_X_KRAFT = KafkaVersion.of('3.7.x.kraft', { tieredStorage: true });

/**
* Kafka version 3.8.x with ZooKeeper metadata mode support
*
* @see https://docs.aws.amazon.com/msk/latest/developerguide/metadata-management.html#msk-get-connection-string
*/
public static readonly V3_8_X = KafkaVersion.of('3.8.x', { tieredStorage: true });

/**
* Kafka version 3.8.x with KRaft (Apache Kafka Raft) metadata mode support
*
* @see https://docs.aws.amazon.com/msk/latest/developerguide/metadata-management.html#kraft-intro
*/
public static readonly V3_8_X_KRAFT = KafkaVersion.of('3.8.x.kraft', { tieredStorage: true });
/**
* Custom cluster version
* @param version custom version number
Expand Down
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-msk-alpha/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ describe('MSK Cluster', () => {
[msk.KafkaVersion.V3_6_0, '3.6.0'],
[msk.KafkaVersion.V3_7_X, '3.7.x'],
[msk.KafkaVersion.V3_7_X_KRAFT, '3.7.x.kraft'],
[msk.KafkaVersion.V3_8_X, '3.8.x'],
[msk.KafkaVersion.V3_8_X_KRAFT, '3.8.x.kraft'],
],
)('created with expected Kafka version %j', (parameter, result) => {
new msk.Cluster(stack, 'Cluster', {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 29623d1

Please sign in to comment.