【问题标题】:Template format error: [/Resources/ElasticsearchDomain] resource definition is malformed模板格式错误:[/Resources/ElasticsearchDomain] 资源定义格式错误
【发布时间】:2021-05-02 14:13:59
【问题描述】:

你能帮忙看看这里出了什么问题吗?我收到 [/Resources/ElasticsearchDomain] 资源定义格式错误

AWSTemplateFormatVersion: '2010-09-09'
Description: ElasticsearchDomain resource
Resources:
  ElasticsearchDomain:
  Type: AWS::Elasticsearch::Domain
  Properties:
    DomainName: "anvika"
    ElasticsearchClusterConfig:
      DedicatedMasterEnabled: "true"
      InstanceCount: "1"
      ZoneAwarenessEnabled: "false"
      InstanceType: "t2.small.elasticsearch"
    EBSOptions:
      EBSEnabled: true
      Iops: 0
      VolumeSize: 10
      VolumeType: "gp2"
    AccessPolicies:
      Version: "2012-10-17"
      Statement:
      - Effect: Allow
        Principal:
         AWS: "*"
        Action:
        - es:ESHttp*
        Condition:
          IpAddress:
            aws:SourceIp:
            - 192.0.2.0/24
        Resource: arn:aws:es:us-west-1:987654321098:domain/anvika/*

【问题讨论】:

    标签: amazon-web-services search amazon-cloudformation


    【解决方案1】:

    您有几个缩进问题。

    1. 你需要缩进ElasticsearchDomain:下面的所有内容
    2. 您的数组需要缩进。
    AWSTemplateFormatVersion: '2010-09-09'
    Description: ElasticsearchDomain resource
    Resources:
      ElasticsearchDomain:
        Type: AWS::Elasticsearch::Domain
        Properties:
          DomainName: "anvika"
          ElasticsearchClusterConfig:
            DedicatedMasterEnabled: "true"
            InstanceCount: "1"
            ZoneAwarenessEnabled: "false"
            InstanceType: "t2.small.elasticsearch"
          EBSOptions:
            EBSEnabled: true
            Iops: 0
            VolumeSize: 10
            VolumeType: "gp2"
          AccessPolicies:
            Version: "2012-10-17"
            Statement:
              - Effect: Allow
                Principal:
                  AWS: "*"
                Action:
                  - es:ESHttp*
                Condition:
                  IpAddress:
                    aws:SourceIp:
                      - 192.0.2.0/24
                Resource: arn:aws:es:us-west-1:987654321098:domain/anvika/*
    

    【讨论】:

      猜你喜欢
      • 2021-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-14
      • 2015-06-05
      相关资源
      最近更新 更多