2017-06-19 132 views

回答

6

您可以將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 
+0

完美。這就是我需要的。謝謝 :-) – deosha