Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1658,16 +1658,6 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable {
'`iops` may only be specified if the `volumeType` is `PROVISIONED_IOPS_SSD`, `PROVISIONED_IOPS_SSD_IO2` or `GENERAL_PURPOSE_SSD_GP3`.',
);
}
// Enforce minimum & maximum IOPS:
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
const iopsRanges: { [key: string]: { Min: number; Max: number } } = {};
iopsRanges[ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3] = { Min: 3000, Max: 16000 };
iopsRanges[ec2.EbsDeviceVolumeType.PROVISIONED_IOPS_SSD] = { Min: 100, Max: 64000 };
iopsRanges[ec2.EbsDeviceVolumeType.PROVISIONED_IOPS_SSD_IO2] = { Min: 100, Max: 64000 };
const { Min, Max } = iopsRanges[volumeType];
if (props.ebs?.iops < Min || props.ebs?.iops > Max) {
throw new Error(`\`${volumeType}\` volumes iops must be between ${Min} and ${Max}.`);
}

// Enforce maximum ratio of IOPS/GiB:
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html
Expand Down
48 changes: 0 additions & 48 deletions packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2558,54 +2558,6 @@ describe('EBS Options Configurations', () => {
new Domain(stack, `Domain${idx++}`, domainProps);
}).toThrow('General Purpose EBS volumes can not be used with Iops or Throughput configuration');

expect(() => {
const domainProps: DomainProps = {
version: EngineVersion.OPENSEARCH_2_5,
ebs: {
volumeSize: 30,
volumeType: EbsDeviceVolumeType.PROVISIONED_IOPS_SSD,
iops: 99,
},
};
new Domain(stack, `Domain${idx++}`, domainProps);
}).toThrow('`io1` volumes iops must be between 100 and 64000.');

expect(() => {
const domainProps: DomainProps = {
version: EngineVersion.OPENSEARCH_2_5,
ebs: {
volumeSize: 30,
volumeType: EbsDeviceVolumeType.PROVISIONED_IOPS_SSD,
iops: 64001,
},
};
new Domain(stack, `Domain${idx++}`, domainProps);
}).toThrow('`io1` volumes iops must be between 100 and 64000.');

expect(() => {
const domainProps: DomainProps = {
version: EngineVersion.OPENSEARCH_2_5,
ebs: {
volumeSize: 30,
volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3,
iops: 16001,
},
};
new Domain(stack, `Domain${idx++}`, domainProps);
}).toThrow('`gp3` volumes iops must be between 3000 and 16000.');

expect(() => {
const domainProps: DomainProps = {
version: EngineVersion.OPENSEARCH_2_5,
ebs: {
volumeSize: 30,
volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3,
iops: 2999,
},
};
new Domain(stack, `Domain${idx++}`, domainProps);
}).toThrow('`gp3` volumes iops must be between 3000 and 16000.');

expect(() => {
const domainProps: DomainProps = {
version: EngineVersion.OPENSEARCH_2_5,
Expand Down