2
我需要使用AWS elasticsearch服务,但也希望将其自动化。我们有无服务器配置。我们如何使用serverless.yml创建AWS elasticsearch服务?如何使用serverless.yml部署AWS elasticsearch
我需要使用AWS elasticsearch服务,但也希望将其自动化。我们有无服务器配置。我们如何使用serverless.yml创建AWS elasticsearch服务?如何使用serverless.yml部署AWS elasticsearch
您可以将CloudFormation资源添加到“资源”部分。对于ElasticSearch,这看起来像这样。
service: aws-nodejs
provider:
name: aws
runtime: nodejs6.10
functions:
hello:
handler: handler.hello
environment:
elasticURL:
Fn::GetAtt: [ ElasticSearchInstance , DomainEndpoint ]
resources:
Resources:
ElasticSearchInstance:
Type: AWS::Elasticsearch::Domain
Properties:
EBSOptions:
EBSEnabled: true
VolumeType: gp2
VolumeSize: 10
ElasticsearchClusterConfig:
InstanceType: t2.small.elasticsearch
InstanceCount: 1
DedicatedMasterEnabled: false
ZoneAwarenessEnabled: false
ElasticsearchVersion: 5.3
完美。这就是我需要的。谢谢 :-) – deosha