Home > Mobile >  Invalid instance type when creating elasticsearch domain through cloudformation
Invalid instance type when creating elasticsearch domain through cloudformation

Time:12-27

I am trying to deploy an elasticsearch domain through CFT, but getting following error:

Invalid instance type: r6g.large.elasticsearch (Service: AWSElasticsearch; Status Code: 409; Error Code: InvalidTypeException;

My CFT is :

Resources:
  ElasticsearchDomain:
    Type: 'AWS::Elasticsearch::Domain'
    Properties:
      DomainName: test
      ElasticsearchVersion: 7.10
      ElasticsearchClusterConfig:
        InstanceCount: '1'
        InstanceType: r6g.large.elasticsearch
      EBSOptions:
        EBSEnabled: true
        Iops: '0'
        VolumeSize: '10'
        VolumeType: 'standard'
      AccessPolicies:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Principal:
              AWS: '*'
            Action: 'es:*'
            Resource: '*'
      AdvancedOptions:
        rest.action.multi.allow_explicit_index: true
      Tags:
        - Key: foo
          Value: bar
      VPCOptions:
        SubnetIds:
          - Ref: subnet
        SecurityGroupIds:
          - Ref: mySecurityGroup
  vpc:
    Type: 'AWS::EC2::VPC'
    Properties:
      CidrBlock: 10.0.0.0/16
  subnet:
    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId:
        Ref: vpc
      CidrBlock: 10.0.0.0/24
      AvailabilityZone: us-west-2a
  mySecurityGroup:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: test
      VpcId:
        Ref: vpc
      GroupName: testsg
      SecurityGroupIngress:
        - FromPort: 443
          IpProtocol: tcp
          ToPort: 443
          CidrIp: 0.0.0.0/0

please ignore the hard coding of variables, that was done to eliminate use of parameters. I can see in documentation that r6g.large is indeed supported. the code works when using instance type as given in this answer, but my use-case requires having r6g.large as instance type. Any help would be appreciated.

CodePudding user response:

problem isn't with your instance type, it's the version your are using for elasticSearch in your CFT.

ElasticsearchVersion: 7.10

The R6G instance types require Elasticsearch 7.9 or later or any version of OpenSearch. basically it's compatible only with latest one, please change the version and give a try.

  • Related