2016-06-24 44 views
0

我得到一個錯誤創建堆棧:雲的形成模板 - 創建錯誤

參數組名不能與參數子網

{ 
     "Description": "AWS CloudFormation to Airflow production enviroment", 
     "Resources": { 
      "InstanceSecurityGroup": { 
       "Properties": { 
        "GroupDescription": "Enable SSH and HTTP access on the inbound port", 
        "SecurityGroupIngress": [ 
         { 
          "CidrIp": "0.0.0.0/0", 
          "FromPort": "22", 
          "IpProtocol": "tcp", 
          "ToPort": "22" 
         }, 
         { 
          "CidrIp": "0.0.0.0/0", 
          "FromPort": "8080", 
          "IpProtocol": "tcp", 
          "ToPort": "8080" 
         } 
        ], 
        "VpcId": "vpc-f283cb97" 
       }, 
       "Type": "AWS::EC2::SecurityGroup" 
      }, 
      "airflow": { 
       "Properties": { 
        "ImageId": "ami-f303fb93", 
        "InstanceType": "t2.micro", 
        "SecurityGroups": [ 
         { 
          "Ref": "InstanceSecurityGroup" 
         } 
        ], 
        "SubnetId": "subnet-0820796d", 
        "Tags": [ 
         { 
          "Key": "Name", 
          "Value": "ec2-airflow-production" 
         } 
        ] 
       }, 
       "Type": "AWS::EC2::Instance" 
      } 
     } 
    } 

回答

1

您需要安全組ID這裏,而不是的名義使用安全組。將「InstanceSecurityGroup」更改爲安全組ID,它將起作用。

"Ref": "InstanceSecurityGroup" 
相關問題