-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(msk): support Express brokers #34741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
25b01ca
f95c010
3851f70
ae768c8
e01e65b
1a958b8
2cc0f9c
c2c11a1
dcea70d
2048b76
ab1180c
13272d5
dea8360
f2dc968
3d2d3a6
88f278a
212ed71
70e0382
63e0669
a63d8cf
fe2e105
4564190
9ee8d63
1ce4075
be5a1f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,6 +98,15 @@ export interface ClusterProps { | |
| */ | ||
| readonly instanceType?: ec2.InstanceType; | ||
|
|
||
| /** | ||
| * Whether to use an Express Broker. | ||
| * When set to true, the cluster will be created with Express Brokers. | ||
| * When this is set to true, instanceType must also be specified. | ||
| * | ||
| * @default false | ||
| */ | ||
| readonly express?: boolean; | ||
|
||
|
|
||
| /** | ||
| * The AWS security groups to associate with the elastic network interfaces in order to specify who can | ||
| * connect to and communicate with the Amazon MSK cluster. | ||
|
|
@@ -502,8 +511,26 @@ export class Cluster extends ClusterBase { | |
| throw new core.ValidationError('EBS volume size should be in the range 1-16384', this); | ||
| } | ||
|
|
||
| if (props.express) { | ||
|
||
| if (!props.instanceType) { | ||
| throw new core.ValidationError('`instanceType` must also be specified when `express` is true.', this); | ||
| } | ||
| if (props.ebsStorageInfo) { | ||
| throw new core.ValidationError('`ebsStorageInfo` is not supported when `express` is true.', this); | ||
| } | ||
| if (props.storageMode) { | ||
| throw new core.ValidationError('`storageMode` is not supported when `express` is true.', this); | ||
| } | ||
| if (props.logging) { | ||
| throw new core.ValidationError('`logging` is not supported when `express` is true.', this); | ||
| } | ||
| if (subnetSelection.subnets.length < 3) { | ||
| throw new core.ValidationError(`Express cluster requires at least 3 subnets, got ${subnetSelection.subnets.length}`, this); | ||
| } | ||
| } | ||
|
|
||
| const instanceType = props.instanceType | ||
| ? this.mskInstanceType(props.instanceType) | ||
| ? this.mskInstanceType(props.instanceType, props.express) | ||
| : this.mskInstanceType( | ||
| ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE), | ||
| ); | ||
|
|
@@ -598,7 +625,7 @@ export class Cluster extends ClusterBase { | |
| }, | ||
| })); | ||
| } | ||
| const loggingInfo = { | ||
| const loggingInfo = props.express ? undefined : { | ||
| brokerLogs: { | ||
| cloudWatchLogs: { | ||
| enabled: | ||
|
|
@@ -678,7 +705,7 @@ export class Cluster extends ClusterBase { | |
| securityGroups: this.connections.securityGroups.map( | ||
| (group) => group.securityGroupId, | ||
| ), | ||
| storageInfo: { | ||
| storageInfo: props.express ? undefined : { | ||
| ebsStorageInfo: { | ||
| volumeSize: volumeSize, | ||
| }, | ||
|
|
@@ -691,7 +718,7 @@ export class Cluster extends ClusterBase { | |
| configurationInfo: props.configurationInfo, | ||
| enhancedMonitoring: props.monitoring?.clusterMonitoringLevel, | ||
| openMonitoring: openMonitoring, | ||
| storageMode: props.storageMode, | ||
| storageMode: props.express ? undefined : props.storageMode, | ||
| loggingInfo: loggingInfo, | ||
| clientAuthentication, | ||
| }); | ||
|
|
@@ -706,8 +733,9 @@ export class Cluster extends ClusterBase { | |
| }); | ||
| } | ||
|
|
||
| private mskInstanceType(instanceType: ec2.InstanceType): string { | ||
| return `kafka.${instanceType.toString()}`; | ||
| private mskInstanceType(instanceType: ec2.InstanceType, express?:boolean): string { | ||
| const prefix = express ? 'express.' : 'kafka.'; | ||
| return `${prefix}${instanceType.toString()}`; | ||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It would also be good to include information about the supported broker sizes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
https://github.com/aws/aws-cdk/pull/34741/files#diff-4406b784e4e36caa633087e16dac06881e3c0c2f3443fbb0770bd3bd37fc3aa9R248