AWS云形成-模板验证错误:模板参数属性'Properties'无效

时间:2019-05-24 04:18:47

标签: yaml

我正在尝试运行此简单的Yaml模板,但它不断弹出并显示以下错误:

“模板验证错误:模板参数属性'Properties'无效”

有没有可以检查语法错误的工具?

Parameters:
  #Instance Type  
  InstanceType:
    Description: WebServer EC2 instance type (has default, AllowedValues)
    Type: String
    Default: t2.small
    AllowedValues:
      - t1.micro
      - t2.nano
      - t2.micro
      - t2.small
    ConstraintDescription: must be a valid EC2 instance type.
  #SSH Key  
  KeyName:
    Description: Name of an existing EC2 KeyPair to enable SSH access to the instances. Linked to AWS Parameter
    Type: AWS::EC2::KeyPair::KeyName
    ConstraintDescription: must be the name of an existing EC2 KeyPair.
      #Security Group  
  BezbedGrupa:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Enable SSH access via port 22
      GroupName: FORMEJSN
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: '22'
          ToPort: '22'
          CidrIp: 0.0.0.0/0
        - IpProtocol: tcp
          FromPort: '80'
          ToPort: '80'
          CidrIp: 0.0.0.0/0
        - IpProtocol: tcp
          FromPort: '3306'
          ToPort: '3306'
          CidrIp: 0.0.0.0/0

Resources:
  Server1:
    Type: AWS::EC2::Instance
    Properties:
      #we reference the InstanceType parameter
      InstanceType: !Ref InstanceType
      ImageId: "ami-0c6b1d09930fac512"
      KeyName: !Ref KeyName
      SecurityGroups:
        - !Ref BezbedGrupa
      Tags:
        -
          Key: Name 
          Value: Server1

  Server2:
    Type: AWS::EC2::Instance
    Properties:
      #we reference the InstanceType parameter
      InstanceType: !Ref InstanceType
      ImageId: "ami-0c6b1d09930fac512"
      KeyName: !Ref KeyName
      SecurityGroups:
        - !Ref BezbedGrupa
      Tags:
        -
          Key: Name 
          Value: Server2

0 个答案:

没有答案