云形成模板 - 创建错误

Cloud formation Template - Creation error

我在创建堆栈时遇到错误:

参数groupName不能与参数subnet一起使用

 {
        "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"
            }
        }
    }

此处需要安全组 ID,而不是安全组名称。将 "InstanceSecurityGroup" 更改为安全组 ID 即可。

"Ref": "InstanceSecurityGroup"