gpt4 book ai didi

amazon-web-services - 如何使用 serverless.yml 部署 AWS elasticsearch

转载 作者:行者123 更新时间:2023-11-29 02:45:20 25 4
gpt4 key购买 nike

我需要使用 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

关于amazon-web-services - 如何使用 serverless.yml 部署 AWS elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44626308/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com