通过 cloudformation 创建 elasticsearch 域时实例类型无效

Invalid instance type when creating elasticsearch domain through cloudformation

我正在尝试通过 CFT 部署 elasticsearch 域,但出现以下错误:

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

我的 CFT 是:

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

请忽略变量的硬编码,这样做是为了避免使用参数。 我可以在文档中看到确实支持 r6g.large 。该代码在使用 this 答案中给出的实例类型时有效,但我的用例需要将 r6g.large 作为实例类型。任何帮助将不胜感激。

问题不在于您的实例类型,而是您在 CFT 中用于 elasticSearch 的版本。

ElasticsearchVersion: 7.10

R6G 实例类型需要 Elasticsearch 7.9 或更高版本或任何版本的 OpenSearch。基本上只兼容最新的,请换个版本试试