Skip to content
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

OpenSearch: Stack Deployment Issue - CDK Opensearch is not Allow gp3 IOPS greater than 16k #29711

Open
ashishdhingra opened this issue Apr 3, 2024 · 0 comments
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. effort/medium Medium work item – several days of effort needs-review p2

Comments

@ashishdhingra
Copy link
Contributor

Describe the bug

Typescript CDK limits the IOPS of the GP3 EBS volume for OpenSearch domains to 16000. While this limit is correct for GP3 volumes, OpenSearch allows for IOPS higher than 16000 as it will attach multiple GP3 volumes. Customers attempting to update their OpenSearch domain to use more than 16000 IOPS w/ GP3 are unable to due to this imposed limit.

        // 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}.`);
        }

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts#L1636

Code Snippets: N/A

Errors or Stack Traces :

jsii.errors.JavaScriptError: 
  Error: `gp3` volumes iops must be between 3000 and 16000.
      at new Domain (/tmp/jsii-kernel-yVrGdt/node_modules/aws-cdk-lib/aws-opensearchservice/lib/domain.js:1:14840)
      at Kernel._Kernel_create (/tmp/tmpza50b2vr/lib/program.js:10108:25)
      at Kernel.create (/tmp/tmpza50b2vr/lib/program.js:9779:93)
      at KernelHost.processRequest (/tmp/tmpza50b2vr/lib/program.js:11696:36)
      at KernelHost.run (/tmp/tmpza50b2vr/lib/program.js:11656:22)
      at Immediate._onImmediate (/tmp/tmpza50b2vr/lib/program.js:11657:46)
      at process.processImmediate (node:internal/timers:476:21)

Expected Behavior

CDK OpenSearch construct should allow setting IOPS greater than 16000.

Kindly note that in AWS OpenSearch console, depending on other parameters (like Instance Type, etc.), UI allows setting IOPS upto or greater than 16000 with prescribed lower and upper limits. These parameter and IOPS limits need to be confirmed with OpenSearch team.

Current Behavior

Error is thrown:

jsii.errors.JavaScriptError: 
  Error: `gp3` volumes iops must be between 3000 and 16000.
      at new Domain (/tmp/jsii-kernel-yVrGdt/node_modules/aws-cdk-lib/aws-opensearchservice/lib/domain.js:1:14840)
      at Kernel._Kernel_create (/tmp/tmpza50b2vr/lib/program.js:10108:25)
      at Kernel.create (/tmp/tmpza50b2vr/lib/program.js:9779:93)
      at KernelHost.processRequest (/tmp/tmpza50b2vr/lib/program.js:11696:36)
      at KernelHost.run (/tmp/tmpza50b2vr/lib/program.js:11656:22)
      at Immediate._onImmediate (/tmp/tmpza50b2vr/lib/program.js:11657:46)
      at process.processImmediate (node:internal/timers:476:21)

Reproduction Steps

Refer issue description.

Possible Solution

No response

Additional Information/Context

External customer issue internal ticket for reference: V1321041874

There is a workaround proposed in the ticket:

const domain = new opensearch.Domain(this, 'OpenSearchDomain', {
        version: opensearch.EngineVersion.OPENSEARCH_2_11,
        capacity: {
          masterNodeInstanceType: 'r6g.8xlarge.search',
          masterNodes: 3,
          dataNodeInstanceType: 'r6g.8xlarge.search',
          dataNodes: 2,
        },
        ebs: {
          enabled: true,
          volumeType:  ec2.EbsDeviceVolumeType.GP3,
          volumeSize: 10240,
          iops: 16000,     #<-------This value will get overriden by the lines at the end. 
          throughput: 1000,
        },
        encryptionAtRest: {
          enabled: true,
        },
        nodeToNodeEncryption: true,
        zoneAwareness: {
          enabled: true,
          availabilityZoneCount: 2,
        },
      });

      const cfnDomain = domain.node.defaultChild as opensearch.CfnDomain
      cfnDomain.addPropertyOverride('EBSOptions.Iops', 40000);
      cfnDomain.addPropertyOverride('EBSOptions.Throughput',1187 )

CDK CLI Version

N/A

Framework Version

No response

Node.js Version

N/A

OS

N/A

Language

TypeScript

Language Version

No response

Other information

No response

@ashishdhingra ashishdhingra added bug This issue is a bug. p2 needs-triage This issue or PR still needs to be triaged. @aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package effort/medium Medium work item – several days of effort needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. effort/medium Medium work item – several days of effort needs-review p2
Projects
None yet
Development

No branches or pull requests

1 participant