Skip to content

Commit

Permalink
feat(msk): add Kafka versions 3.1.1, 3.2.0, and and 3.3.1 (#23918)
Browse files Browse the repository at this point in the history
Add support for Apache Kafka versions 3.1.1, 3.2.0 and 3.3.1 in Amazon MSK.

Announcements:
- [3.1.1 and 3.2.0](https://aws.amazon.com/about-aws/whats-new/2022/06/amazon-msk-adds-support-apache-kafka-version-3-1-1-3-2-0/) (Posted On: Jun 22, 2022)
- [3.3.1](https://aws.amazon.com/about-aws/whats-new/2022/10/amazon-msk-support-apache-kafka-version-3-3-1) (Posted On: Oct 26, 2022)

Closes #23899 
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
stefanfreitag authored Feb 22, 2023
1 parent 324ee45 commit 53a1d5f
Show file tree
Hide file tree
Showing 24 changed files with 7,341 additions and 22 deletions.
15 changes: 15 additions & 0 deletions packages/@aws-cdk/aws-msk/lib/cluster-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ export class KafkaVersion {
*/
public static readonly V2_8_1 = KafkaVersion.of('2.8.1');

/**
* Kafka version 3.1.1
*/
public static readonly V3_1_1 = KafkaVersion.of('3.1.1');

/**
* Kafka version 3.2.0
*/
public static readonly V3_2_0 = KafkaVersion.of('3.2.0');

/**
* Kafka version 3.3.1
*/
public static readonly V3_3_1 = KafkaVersion.of('3.3.1');

/**
* Custom cluster version
* @param version custom version number
Expand Down
34 changes: 34 additions & 0 deletions packages/@aws-cdk/aws-msk/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,40 @@ describe('MSK Cluster', () => {
vpc = new ec2.Vpc(stack, 'Vpc');
});

test.each([
[msk.KafkaVersion.V1_1_1, '1.1.1'],
[msk.KafkaVersion.V2_2_1, '2.2.1'],
[msk.KafkaVersion.V2_3_1, '2.3.1'],
[msk.KafkaVersion.V2_4_1_1, '2.4.1.1'],
[msk.KafkaVersion.V2_5_1, '2.5.1'],
[msk.KafkaVersion.V2_6_0, '2.6.0'],
[msk.KafkaVersion.V2_6_1, '2.6.1'],
[msk.KafkaVersion.V2_6_2, '2.6.2'],
[msk.KafkaVersion.V2_6_3, '2.6.3'],
[msk.KafkaVersion.V2_7_0, '2.7.0'],
[msk.KafkaVersion.V2_7_1, '2.7.1'],
[msk.KafkaVersion.V2_7_2, '2.7.2'],
[msk.KafkaVersion.V2_8_0, '2.8.0'],
[msk.KafkaVersion.V2_8_1, '2.8.1'],
[msk.KafkaVersion.V3_1_1, '3.1.1'],
[msk.KafkaVersion.V3_2_0, '3.2.0'],
[msk.KafkaVersion.V3_3_1, '3.3.1'],
],
)('created with expected Kafka version %j', (parameter, result) => {
new msk.Cluster(stack, 'Cluster', {
clusterName: 'cluster',
kafkaVersion: parameter,
vpc,
});

Template.fromStack(stack).hasResource(
'AWS::MSK::Cluster', {},
);
Template.fromStack(stack).hasResourceProperties('AWS::MSK::Cluster', {
KafkaVersion: result,
});
});

test('created with default properties', () => {
new msk.Cluster(stack, 'Cluster', {
clusterName: 'cluster',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"version": "22.0.0",
"version": "30.0.0",
"files": {
"278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4": {
"1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28": {
"source": {
"path": "asset.278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.bundle",
"path": "asset.1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.bundle",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.zip",
"objectKey": "1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"a05397c3727c3e7f038b83dffd978e425efd93679403b58df9e637d090313b4d": {
"e05a31925a856f753d012d462f51a3f4b884235b0fe9c3cea1b63e4c95fcd2c4": {
"source": {
"path": "MskLoggingDefaultTestDeployAssertC2F074AF.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "a05397c3727c3e7f038b83dffd978e425efd93679403b58df9e637d090313b4d.json",
"objectKey": "e05a31925a856f753d012d462f51a3f4b884235b0fe9c3cea1b63e4c95fcd2c4.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
},
"flattenResponse": "false",
"salt": "1673270420990"
"salt": "1677027448917"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -100,6 +100,15 @@
]
}
]
},
{
"Action": [
"kafka:GetBootstrapBrokers"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
Expand All @@ -115,7 +124,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.zip"
"S3Key": "1f3c2cfb18e102edc713fe4c4b4d87572f4297ee4a5e80a5960adf526ee9ea28.zip"
},
"Timeout": 120,
"Handler": "index.handler",
Expand Down
Loading

0 comments on commit 53a1d5f

Please sign in to comment.