Skip to content

(aws_opensearchservice): i4g instances say they need EBS #31764

@kensentor

Description

@kensentor

Describe the bug

Attempting to build an opensearch.Domain object with an opensearch.CapacityConfig object which specifies ig4.2xlarge as its data_node_instance_type parameter yields an error with cdk synth, indicating that ig4.2xlarge instance types require EBS storage.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I expect to be able to create an Opensearch cluster using i4g instances without using EBS.

Current Behavior

An error is thrown:

Traceback (most recent call last):
  File "/Users/kennethhoffmann/adept/scaling-eureka/infra/management_stack/app.py", line 16, in <module>
    ManagementStack(
  File "/Users/kennethhoffmann/.pyenv/versions/3.12/envs/management/lib/python3.12/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kennethhoffmann/adept/scaling-eureka/infra/management_stack/management_stack/management_stack.py", line 61, in __init__
    initialize_opensearch(
  File "/Users/kennethhoffmann/adept/scaling-eureka/infra/management_stack/management_stack/opensearch.py", line 245, in initialize_opensearch
    domain = opensearch.Domain(
             ^^^^^^^^^^^^^^^^^^
  File "/Users/kennethhoffmann/.pyenv/versions/3.12/envs/management/lib/python3.12/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kennethhoffmann/.pyenv/versions/3.12/envs/management/lib/python3.12/site-packages/aws_cdk/aws_opensearchservice/__init__.py", line 7657, in __init__
    jsii.create(self.__class__, self, [scope, id, props])
  File "/Users/kennethhoffmann/.pyenv/versions/3.12/envs/management/lib/python3.12/site-packages/jsii/_kernel/__init__.py", line 334, in create
    response = self.provider.create(
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kennethhoffmann/.pyenv/versions/3.12/envs/management/lib/python3.12/site-packages/jsii/_kernel/providers/process.py", line 365, in create
    return self._process.send(request, CreateResponse)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kennethhoffmann/.pyenv/versions/3.12/envs/management/lib/python3.12/site-packages/jsii/_kernel/providers/process.py", line 342, in send
    raise RuntimeError(resp.error) from JavaScriptError(resp.stack)
RuntimeError: EBS volumes are required when using instance types other than R3, I3, R6GD, or IM4GN.

Reproduction Steps

from aws_cdk import (
    aws_opensearchservice as opensearch,
)

# VPC creation omitted

subnets = vpc.select_subnets(
        availability_zones=opensearch.ZoneAwarenessConfig(
          availability_zone_count=2, enabled=True
       ),
        one_per_az=True,
        subnet_type=ec2.SubnetType.PUBLIC,
    )

security_group = ec2.SecurityGroup(
        stack,
        sg_name,
        allow_all_outbound=True,
        allow_all_ipv6_outbound=True,
        description=f"foo.",
        security_group_name="Opensearch Security Group",
        vpc=vpc,
    )

capacity_config = opensearch.CapacityConfig(
        data_nodes=8,
        data_node_instance_type="i4g.2xlarge.search",
        master_node_instance_type="m7g.large.search",
        master_nodes=3,
        multi_az_with_standby_enabled=False,
    )

os_version = opensearch.EngineVersion.open_search("2.15")

domain = opensearch.Domain(
        stack,
        "OS",
        capacity=capacity_config,
        ebs=ebs_options,
        enable_auto_software_update=True,
        encryption_at_rest=opensearch.EncryptionAtRestOptions(enabled=True),
        enforce_https=use_https,
        fine_grained_access_control=None,
        node_to_node_encryption=True,
        security_groups=[security_group],
        tls_security_policy=opensearch.TLSSecurityPolicy.TLS_1_2,
        version=os_version,
        vpc=vpc,
        vpc_subnets=[ec2.SubnetSelection(subnets=[subnet for subnet in subnets.subnets])],
        zone_awareness=True,
    )

Possible Solution

The list of instance types that does not use EBS appears to be outdated. i4i and i4g both don't use EBS according to https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html

Additional Information/Context

No response

CDK CLI Version

2.162.1 (build 10aa526)

Framework Version

No response

Node.js Version

20.11.1

OS

MacOS 14.6.1

Language

Python

Language Version

Python (3.12)

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-opensearchRelated to the @aws-cdk/aws-opensearchservice packagebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions