Skip to content

Commit 1d15d49

Browse files
authored
fix(opensearchservice): wrong iops limit checks (#33401)
### Issue # (if applicable) Closes #29711. ### Reason for this change The actual IOPS limit depends on a few factors: ![Screenshot 2025-02-11 at 1 15 41 PM](https://github.com/user-attachments/assets/de6ab224-03d6-4573-9c9a-a5b14584fb66) Therefore, It is not trivial to maintain the limit checks in CDK. In addition, when the the service changes the limit, the CDK outdated limits will be a blocker for users to use the new limits. All in all, this check creates blockers more than benefit. ### Description of changes Removed the limit check on IOPS. ### Description of how you validated changes Unit Test that were expecting the error was failing after the removal of the check. Removed those test. ### 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 19e603b commit 1d15d49

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts

-10
Original file line numberDiff line numberDiff line change
@@ -1658,16 +1658,6 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable {
16581658
'`iops` may only be specified if the `volumeType` is `PROVISIONED_IOPS_SSD`, `PROVISIONED_IOPS_SSD_IO2` or `GENERAL_PURPOSE_SSD_GP3`.',
16591659
);
16601660
}
1661-
// Enforce minimum & maximum IOPS:
1662-
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
1663-
const iopsRanges: { [key: string]: { Min: number; Max: number } } = {};
1664-
iopsRanges[ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3] = { Min: 3000, Max: 16000 };
1665-
iopsRanges[ec2.EbsDeviceVolumeType.PROVISIONED_IOPS_SSD] = { Min: 100, Max: 64000 };
1666-
iopsRanges[ec2.EbsDeviceVolumeType.PROVISIONED_IOPS_SSD_IO2] = { Min: 100, Max: 64000 };
1667-
const { Min, Max } = iopsRanges[volumeType];
1668-
if (props.ebs?.iops < Min || props.ebs?.iops > Max) {
1669-
throw new Error(`\`${volumeType}\` volumes iops must be between ${Min} and ${Max}.`);
1670-
}
16711661

16721662
// Enforce maximum ratio of IOPS/GiB:
16731663
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts

-48
Original file line numberDiff line numberDiff line change
@@ -2558,54 +2558,6 @@ describe('EBS Options Configurations', () => {
25582558
new Domain(stack, `Domain${idx++}`, domainProps);
25592559
}).toThrow('General Purpose EBS volumes can not be used with Iops or Throughput configuration');
25602560

2561-
expect(() => {
2562-
const domainProps: DomainProps = {
2563-
version: EngineVersion.OPENSEARCH_2_5,
2564-
ebs: {
2565-
volumeSize: 30,
2566-
volumeType: EbsDeviceVolumeType.PROVISIONED_IOPS_SSD,
2567-
iops: 99,
2568-
},
2569-
};
2570-
new Domain(stack, `Domain${idx++}`, domainProps);
2571-
}).toThrow('`io1` volumes iops must be between 100 and 64000.');
2572-
2573-
expect(() => {
2574-
const domainProps: DomainProps = {
2575-
version: EngineVersion.OPENSEARCH_2_5,
2576-
ebs: {
2577-
volumeSize: 30,
2578-
volumeType: EbsDeviceVolumeType.PROVISIONED_IOPS_SSD,
2579-
iops: 64001,
2580-
},
2581-
};
2582-
new Domain(stack, `Domain${idx++}`, domainProps);
2583-
}).toThrow('`io1` volumes iops must be between 100 and 64000.');
2584-
2585-
expect(() => {
2586-
const domainProps: DomainProps = {
2587-
version: EngineVersion.OPENSEARCH_2_5,
2588-
ebs: {
2589-
volumeSize: 30,
2590-
volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3,
2591-
iops: 16001,
2592-
},
2593-
};
2594-
new Domain(stack, `Domain${idx++}`, domainProps);
2595-
}).toThrow('`gp3` volumes iops must be between 3000 and 16000.');
2596-
2597-
expect(() => {
2598-
const domainProps: DomainProps = {
2599-
version: EngineVersion.OPENSEARCH_2_5,
2600-
ebs: {
2601-
volumeSize: 30,
2602-
volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3,
2603-
iops: 2999,
2604-
},
2605-
};
2606-
new Domain(stack, `Domain${idx++}`, domainProps);
2607-
}).toThrow('`gp3` volumes iops must be between 3000 and 16000.');
2608-
26092561
expect(() => {
26102562
const domainProps: DomainProps = {
26112563
version: EngineVersion.OPENSEARCH_2_5,

0 commit comments

Comments
 (0)