ALIYUN::ElasticSearch::Instance类型用于创建Elasticsearch实例。

语法

{
  "Type": "ALIYUN::ElasticSearch::Instance",
  "Properties": {
    "KibanaWhitelist": List,
    "PublicWhitelist": List,
    "VSwitchId": String,
    "InstanceChargeType": String,
    "Period": Integer,
    "Version": String,
    "DataNode": Map,
    "PrivateWhitelist": List,
    "ResourceGroupId": String,
    "EnablePublic": Boolean,
    "Password": String,
    "MasterNode": Map,
    "Tags": List,
    "Description": String,
    "EnableKibanaPublic": Boolean,
    "YMLConfig": Map,
    "EnableKibanaPrivate": Boolean,
    "ZoneCount": Integer
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
KibanaWhitelist List Kibana的IP白名单列表。
PublicWhitelist List 实例的公网IP白名单列表。
VSwitchId String 交换机ID。
InstanceChargeType String 实例付费类型。 取值:
  • PrePaid:预付费。
  • PostPaid:后付费。
Period Integer 购买Elasticsearch实例的持续时间。 取值:
  • 1(默认值)
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 12
  • 24
  • 36

单位:月。

Version String Elasticsearch版本。 取值:
  • 7.10_with_X-Pack
  • 6.7_with_X-Pack
  • 6.7_with_A-Pack
  • 7.7_with_X-Pack
  • 6.8_with_X-Pack
  • 6.3_with_X-Pack
  • 5.6_with_X-Pack
  • 5.5.3_with_X-Pack
ResourceGroupId String 资源组ID。
EnablePublic Boolean 是否开启实例的公网地址。 取值:
  • true:开启。
  • false(默认值):关闭。
DataNode Map Elasticsearch集群的数据节点设置。 更多信息,请参见DataNode属性
PrivateWhitelist List 在专有网络中设置实例的IP白名单列表。
Password String 实例的密码。 长度为8~32个字符,必须同时包含大写英文字母、小写英文字母、数字和特殊字符中的三项。支持的特殊字符为:!@#$%&*()_+-=
MasterNode Map 主节点设置。 如果指定该参数,将创建专用主节点。

更多信息,请参见MasterNode属性

Tags List 标签。 最多支持添加20个标签。

更多信息,请参见Tags属性

Description String 实例的描述。 长度为0~30个字符,必须以英文字母、数字或汉字开头,可包含英文字母、数字、汉字、下划线(_)和短划线(-)。
EnableKibanaPublic Boolean 是否开启Kibana公网访问。 取值:
  • true:开启。
  • false(默认值):关闭。
YMLConfig Map YAML文件配置。

更多信息,请参见YMLConfig属性

EnableKibanaPrivate Boolean 是否开启Kibana私网访问。 取值:
  • true:开启。
  • false(默认值):关闭。
ZoneCount Integer 实例的可用区个数。 取值:
  • 1(默认值)
  • 2
  • 3

DataNode语法

"DataNode": {
  "Amount": Integer,
  "DiskSize": Integer,
  "Spec": String,
  "DiskType": String,
  "DiskEncryption": Boolean,
  "PerformanceLevel": String
}

DataNode属性

属性名称 类型 必须 允许更新 描述 约束
Amount Integer Elasticsearch集群的数据节点数量。 取值范围:2~50。
DiskSize Integer 单数据节点存储空间。 取值范围:
  • 当DiskType取值为cloud_ssd时:20~6144。
  • 当DiskType取值为cloud_efficiency时:20~20480。如果要存储的数据大于2048 GB,cloud_efficiency只能支持以下数据大小:
    • 2560
    • 3072
    • 3584
    • 4096
    • 4608
    • 5120
    • 5632
    • 6144
    • 8192
    • 10240
    • 12288
    • 14336
    • 16384
    • 18432
    • 20480
    说明 如果要存储的数据大于5120 GB,Elasticsearch版本必须为6.7、7.X或日志增强版。
  • 当DiskType取值为cloud_essd时:20~6144。

单位:GB。

Spec String Elasticsearch实例的数据节点规格。
DiskType String 数据节点磁盘类型。 取值:
  • cloud_ssd:SSD云盘,适合拥有高IOPS,数据响应度较高的在线分析和搜索场景。
  • cloud_efficiency:高效云盘,提供较为低廉的存储能力,适合大规模数据量的日志及分析场景。
  • cloud_essd:ESSD云盘,具有低时延、快速响应、强大的数据吞吐量等优势,适合时延敏感的应用或者I/O密集型业务场景。
DiskEncryption Boolean 是否开启云盘加密。 取值:
  • true:开启。
  • false(默认值):关闭。
PerformanceLevel String ESSD云盘的性能级别。 当DiskType取值为cloud_essd时,该参数必选。取值:
  • PL1
  • PL2
  • PL3

MasterNode语法

"MasterNode": {
  "Amount": Integer,
  "DiskSize": Integer,
  "Spec": String,
  "DiskType": String
}

MasterNode属性

属性名称 类型 必须 允许更新 描述 约束
Amount Integer 主节点数量。 默认值:3。
DiskSize Integer 主节点存储空间。 默认值:20。
Spec String 主节点规格。
DiskType String 主节点磁盘类型。

Tags语法

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags属性

属性名称 类型 必须 允许更新 描述 约束
Key String 标签键。 长度为1~128个字符,不能以aliyunacs:开头,不能包含http://或者https://
Value String 标签值。 长度为0~128个字符,不能以aliyunacs:开头,不能包含http://或者https://

YMLConfig语法

"YMLConfig": {
    "CreateIndex": String,
    "Watcher": String,
    "DestructiveRequiresName": Boolean,
    "AuditLog": Boolean,
    "OtherConfigs": Map
  }

YMLConfig属性

属性名称 类型 必须 允许更新 描述 约束
CreateIndex String 当Elasticsearch实例接收到新文档后,如果没有对应索引,是否允许系统自动创建索引。

对应的YAML文件的配置项为action.auto_create_index。

取值:
  • true:允许系统自动创建索引。
  • false(默认值):不允许系统自动创建索引。
Watcher Boolean 是否开启Watcher。 对应的YAML文件的配置项为xpack.watcher.enabled。

取值:

  • true:开启。开启Watcher后,可使用X-Pack的Watcher功能。请注意定时清理.watcher-history*索引,避免占用大量磁盘空间。
  • false(默认值):关闭。
DestructiveRequiresName Boolean 在删除索引时,是否需要明确指定索引名称。 对应的YAML文件的配置项为action.destructive_requires_name。
取值:
  • true(默认值):在删除索引时,需要明确指定索引名称。
  • false:在删除索引时,不需要明确指定索引名称。
如果选择删除或关闭时索引名称支持通配符,则可以使用通配符进行批量删除索引。索引删除后不可恢复,请谨慎使用此配置。
AuditLog Boolean 是否开启Auditlog索引。 取值:
  • true:开启。开启Auditlog索引后,系统会记录Elasticsearch实例对应的增、删、改、查等操作产生的审计日志,该日志信息会占用您的磁盘空间,同时也会影响性能。不建议开启,请谨慎使用此配置。

    更多信息,请参见配置Auditlog

  • false(默认值):关闭。
说明 Elasticsearch 7.0及以上版本暂不支持配置该参数。
OtherConfigs Map 其他配置。 支持的部分配置项如下(以下配置项,如果没有标识具体适用于哪个Elasticsearch版本,默认兼容Elasticsearch 5.x、6.x和7.x版本):
  • 配置CORS访问
    • http.cors.enabled
    • http.cors.allow-origin
    • http.cors.max-age
    • http.cors.allow-methods
    • http.cors.allow-headers
    • http.cors.allow-credentials
  • 配置reindex白名单
    • reindex.remote.whitelist
  • 配置Auditlog
    • xpack.security.audit.enabled
    • xpack.security.audit.index.bulk_size
    • xpack.security.audit.index.flush_interval
    • xpack.security.audit.index.rollover
    • xpack.security.audit.index.events.include
    • xpack.security.audit.index.events.exclude
    • xpack.security.audit.index.events.emit_request_body
  • 配置queue大小
    • thread_pool.bulk.queue_size(适用于Elasticsearch 5.x版本)
    • thread_pool.write.queue_size(适用于Elasticsearch 6.x及7.x版本)
    • thread_pool.search.queue_size
  • 自定义SQL插件配置
    • xpack.sql.enabled:默认情况下Elasticsearch实例会启用X-Pack自带的SQL插件,如需上传自定义的SQL插件,请将xpack.sql.enabled设置为false。

返回值

Fn::GetAtt

  • Status:Elasticsearch实例的状态。
  • KibanaDomain:Kibana地址。
  • PublicDomain:实例的公网地址。
  • Domain:实例的内网地址。
  • InstanceId:Elasticsearch实例的ID。
  • KibanaPort:Kibana的访问端口。
  • Port:实例连接端口。
  • VSwitchId:交换机ID。
  • Version:实例版本。
  • InstanceChargeType:实例付费类型。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "MasterNode": {
      "Type": "Json",
      "Description": "The dedicated master node setting. If specified, dedicated master node will be created."
    },
    "Description": {
      "Type": "String",
      "Description": "The description of instance. It a string of 0 to 30 characters. It can contain numbers, letters, underscores, (_) and hyphens (-). It must start with a letter, a number or Chinese character.",
      "MaxLength": 30
    },
    "EnableKibanaPrivate": {
      "Type": "Boolean",
      "Description": "Enables or disables intranet access to Kibana.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "ResourceGroupId": {
      "Type": "String",
      "Description": "The ID of the resource group."
    },
    "PublicWhitelist": {
      "Type": "CommaDelimitedList",
      "Description": "Set the instance's IP whitelist in Internet. The AllocatePublicAddress should be true."
    },
    "InstanceChargeType": {
      "Type": "String",
      "Description": "Valid values are PrePaid, PostPaid, Default to PostPaid.",
      "AllowedValues": [
        "Subscription",
        "PrePaid",
        "PrePay",
        "Prepaid",
        "PayAsYouGo",
        "PostPaid",
        "PayOnDemand",
        "Postpaid"
      ],
      "Default": "PostPaid"
    },
    "EnableKibanaPublic": {
      "Type": "Boolean",
      "Description": "Enables or disables Internet access to Kibana.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of VSwitch."
    },
    "Period": {
      "Type": "Number",
      "Description": "The duration that you will buy Elasticsearch instance (in month). It is valid when instance_charge_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.",
      "AllowedValues": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        12,
        24,
        36
      ],
      "Default": 1
    },
    "EnablePublic": {
      "Type": "Boolean",
      "Description": "Whether enable public access. If properties is true, will allocate public address.Default: false.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "PrivateWhitelist": {
      "Type": "CommaDelimitedList",
      "Description": "Set the instance's IP whitelist in VPC network."
    },
    "Version": {
      "Type": "String",
      "Description": "Elasticsearch version. Supported values: 5.5.3_with_X-Pack, 6.3_with_X-Pack, 6.7_with_X-Pack, 7.4_with_X-Pack, 6.8, 7.4, 7.7 and so on."
    },
    "DataNode": {
      "Type": "Json",
      "Description": "The Elasticsearch cluster's data node setting."
    },
    "KibanaWhitelist": {
      "Type": "CommaDelimitedList",
      "Description": "Set the Kibana's IP whitelist in internet network."
    },
    "YMLConfig": {
      "Type": "Json",
      "Description": "In the YML Configuration section of the Cluster \nConfiguration page of your Alibaba Cloud Elasticsearch cluster, \nyou can enable the Auto Indexing, Audit Log Indexing, or Watcher feature."
    },
    "Tags": {
      "Type": "Json",
      "Description": "Tags to attach to instance. Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.",
      "MaxLength": 20
    },
    "ZoneCount": {
      "Type": "Number",
      "AllowedValues": [
        1,
        2,
        3
      ]
    },
    "Password": {
      "Type": "String",
      "Description": "The password of the instance. The password can be 8 to 32 characters in length and must contain three of the following conditions: uppercase letters, lowercase letters, numbers, and special characters (!@#$%*()_+-=)."
    }
  },
  "Resources": {
    "Instance": {
      "Type": "ALIYUN::ElasticSearch::Instance",
      "Properties": {
        "MasterNode": {
          "Ref": "MasterNode"
        },
        "Description": {
          "Ref": "Description"
        },
        "EnableKibanaPrivate": {
          "Ref": "EnableKibanaPrivate"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "PublicWhitelist": {
          "Ref": "PublicWhitelist"
        },
        "InstanceChargeType": {
          "Ref": "InstanceChargeType"
        },
        "EnableKibanaPublic": {
          "Ref": "EnableKibanaPublic"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "Period": {
          "Ref": "Period"
        },
        "EnablePublic": {
          "Ref": "EnablePublic"
        },
        "PrivateWhitelist": {
          "Ref": "PrivateWhitelist"
        },
        "Version": {
          "Ref": "Version"
        },
        "DataNode": {
          "Ref": "DataNode"
        },
        "KibanaWhitelist": {
          "Ref": "KibanaWhitelist"
        },
        "YMLConfig": {
          "Ref": "YMLConfig"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "ZoneCount": {
          "Ref": "ZoneCount"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "Status": {
      "Description": "The Elasticsearch instance status. Includes active, activating, inactive. Some operations are denied when status is not active.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Status"
        ]
      }
    },
    "Version": {
      "Description": "Elasticsearch version.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Version"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of the Elasticsearch instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "InstanceId"
        ]
      }
    },
    "InstanceChargeType": {
      "Description": "Instance charge type.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "InstanceChargeType"
        ]
      }
    },
    "KibanaPort": {
      "Description": "Kibana console port.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "KibanaPort"
        ]
      }
    },
    "VSwitchId": {
      "Description": "The ID of VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "VSwitchId"
        ]
      }
    },
    "Port": {
      "Description": " Instance connection port.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Port"
        ]
      }
    },
    "Domain": {
      "Description": "Instance connection domain (only VPC network access supported).",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Domain"
        ]
      }
    },
    "KibanaDomain": {
      "Description": "Kibana console domain (Internet access supported).",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "KibanaDomain"
        ]
      }
    },
    "PublicDomain": {
      "Description": "Instance public connection domain.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "PublicDomain"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DataNode:
    Description: The Elasticsearch cluster's data node setting.
    Type: Json
  Description:
    Description: The description of instance. It a string of 0 to 30 characters. It
      can contain numbers, letters, underscores, (_) and hyphens (-). It must start
      with a letter, a number or Chinese character.
    MaxLength: 30
    Type: String
  EnableKibanaPrivate:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: Enables or disables intranet access to Kibana.
    Type: Boolean
  EnableKibanaPublic:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: Enables or disables Internet access to Kibana.
    Type: Boolean
  EnablePublic:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: 'Whether enable public access. If properties is true, will allocate
      public address.Default: false.'
    Type: Boolean
  InstanceChargeType:
    AllowedValues:
    - Subscription
    - PrePaid
    - PrePay
    - Prepaid
    - PayAsYouGo
    - PostPaid
    - PayOnDemand
    - Postpaid
    Default: PostPaid
    Description: Valid values are PrePaid, PostPaid, Default to PostPaid.
    Type: String
  KibanaWhitelist:
    Description: Set the Kibana's IP whitelist in internet network.
    Type: CommaDelimitedList
  MasterNode:
    Description: The dedicated master node setting. If specified, dedicated master
      node will be created.
    Type: Json
  Password:
    Description: 'The password of the instance. The password can be 8 to 32 characters
      in length and must contain three of the following conditions: uppercase letters,
      lowercase letters, numbers, and special characters (!@#$%*()_+-=).'
    Type: String
  Period:
    AllowedValues:
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    - 12
    - 24
    - 36
    Default: 1
    Description: 'The duration that you will buy Elasticsearch instance (in month).
      It is valid when instance_charge_type is PrePaid. Valid values: [1~9], 12, 24,
      36. Default to 1.'
    Type: Number
  PrivateWhitelist:
    Description: Set the instance's IP whitelist in VPC network.
    Type: CommaDelimitedList
  PublicWhitelist:
    Description: Set the instance's IP whitelist in Internet. The AllocatePublicAddress
      should be true.
    Type: CommaDelimitedList
  ResourceGroupId:
    Description: The ID of the resource group.
    Type: String
  Tags:
    Description: Tags to attach to instance. Max support 20 tags to add during create
      instance. Each tag with two properties Key and Value, and Key is required.
    MaxLength: 20
    Type: Json
  VSwitchId:
    Description: The ID of VSwitch.
    Type: String
  Version:
    Description: 'Elasticsearch version. Supported values: 5.5.3_with_X-Pack, 6.3_with_X-Pack,
      6.7_with_X-Pack, 7.4_with_X-Pack, 6.8, 7.4, 7.7 and so on.'
    Type: String
  YMLConfig:
    Description: "In the YML Configuration section of the Cluster \nConfiguration\
      \ page of your Alibaba Cloud Elasticsearch cluster, \nyou can enable the Auto\
      \ Indexing, Audit Log Indexing, or Watcher feature."
    Type: Json
  ZoneCount:
    AllowedValues:
    - 1
    - 2
    - 3
    Type: Number
Resources:
  Instance:
    Properties:
      DataNode:
        Ref: DataNode
      Description:
        Ref: Description
      EnableKibanaPrivate:
        Ref: EnableKibanaPrivate
      EnableKibanaPublic:
        Ref: EnableKibanaPublic
      EnablePublic:
        Ref: EnablePublic
      InstanceChargeType:
        Ref: InstanceChargeType
      KibanaWhitelist:
        Ref: KibanaWhitelist
      MasterNode:
        Ref: MasterNode
      Password:
        Ref: Password
      Period:
        Ref: Period
      PrivateWhitelist:
        Ref: PrivateWhitelist
      PublicWhitelist:
        Ref: PublicWhitelist
      ResourceGroupId:
        Ref: ResourceGroupId
      Tags:
        Ref: Tags
      VSwitchId:
        Ref: VSwitchId
      Version:
        Ref: Version
      YMLConfig:
        Ref: YMLConfig
      ZoneCount:
        Ref: ZoneCount
    Type: ALIYUN::ElasticSearch::Instance
Outputs:
  Domain:
    Description: Instance connection domain (only VPC network access supported).
    Value:
      Fn::GetAtt:
      - Instance
      - Domain
  InstanceChargeType:
    Description: Instance charge type.
    Value:
      Fn::GetAtt:
      - Instance
      - InstanceChargeType
  InstanceId:
    Description: The ID of the Elasticsearch instance.
    Value:
      Fn::GetAtt:
      - Instance
      - InstanceId
  KibanaDomain:
    Description: Kibana console domain (Internet access supported).
    Value:
      Fn::GetAtt:
      - Instance
      - KibanaDomain
  KibanaPort:
    Description: Kibana console port.
    Value:
      Fn::GetAtt:
      - Instance
      - KibanaPort
  Port:
    Description: ' Instance connection port.'
    Value:
      Fn::GetAtt:
      - Instance
      - Port
  PublicDomain:
    Description: Instance public connection domain.
    Value:
      Fn::GetAtt:
      - Instance
      - PublicDomain
  Status:
    Description: The Elasticsearch instance status. Includes active, activating, inactive.
      Some operations are denied when status is not active.
    Value:
      Fn::GetAtt:
      - Instance
      - Status
  VSwitchId:
    Description: The ID of VSwitch.
    Value:
      Fn::GetAtt:
      - Instance
      - VSwitchId
  Version:
    Description: Elasticsearch version.
    Value:
      Fn::GetAtt:
      - Instance
      - Version

更多示例,请参见:JSON示例YAML示例