以下是在 AWS Elasticsearch 控制台中创建新版本集群的代码示例:
aws es create-elasticsearch-domain \
--domain-name my-new-domain \
--elasticsearch-version 7.1 \
--ebs-options "EBSEnabled=true,VolumeType=gp2,VolumeSize=10" \
--access-policies '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:root"},"Action":"es:*","Resource":"arn:aws:es:us-west-2:123456789012:domain/my-new-domain/*"},{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:user/my-username"},"Action":"es:*","Resource":"arn:aws:es:us-west-2:123456789012:domain/my-new-domain/*","Condition":{"IpAddress":{"aws:SourceIp":"123.456.789.012"}}}]}' \
--vpc-options SubnetIds=subnet-1234abcd,SecurityGroupIds=sg-5678efgh
请根据您的具体需求修改每个参数,并根据需要添加其他参数。 详细信息,请参见 AWS Elasticsearch 文档。