amazon-web-services - 模板格式错误: [/Resources/ElasticsearchDomain] resource definition is malformed

标签 amazon-web-services search aws-cloudformation

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

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/*

最佳答案

您有几个缩进问题。

  1. 您需要缩进Elasticsearch Domain:下面的所有内容
  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/*

关于amazon-web-services - 模板格式错误: [/Resources/ElasticsearchDomain] resource definition is malformed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67353437/

相关文章:

java - 如何检查 dynamoDB 过滤器表达式中是否不存在属性

php - 使用 Amazon Web Services PHP SDK 的 SenderID

excel - 搜索文件并返回路径

amazon-web-services - CodePipeline 找不到我的 Yaml 模板

amazon-web-services - cfn-init 检测什么类型的更改?

c++ - 我的快速选择算法没有返回正确的值

.net - 如何在 NHibernate 中使用带有枚举属性的 ICriteria

python - 使用 Lambda 将 StackId 写入 S3

amazon-web-services - 如何从 EventBridge 规则定义步骤函数执行名称?

amazon-web-services - 从 AWS lambda 设置 http 响应 header