Folgendes ist meine Vorlage mit vpc, Subnetz, Sicherheitsgruppe, Startkonfiguration und Autoscaling. Ich kann Lauch-Konfiguration und Autoscaling-Gruppe erstellen, aber meine Autoscaling-Gruppe startet Instanzen nicht. Ich bin konfrontiert VPC security groups may not be used for a non-VPC launch
Fehler.Cloud-Konfiguration: VPC-Sicherheitsgruppen dürfen nicht für einen Nicht-VPC-Start verwendet werden
{
"myvpc": {
"Type": "AWS: : EC2: : VPC",
"Properties": {
"CidrBlock": "10.0.0.0/16",
"EnableDnsSupport": "true",
"EnableDnsHostnames": "true",
"InstanceTenancy": "default"
}
},
"mySubnet": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "myvpc"
},
"CidrBlock": "10.0.1.0/24",
"AvailabilityZone": "us-east-1a",
"Tags": [
{
"Key": "mysubnet",
"Value": "mysubnet"
}
]
}
},
"ec2Security": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "my CloudFormation security group",
"VpcId": {
"Ref": "myvpc"
},
"SecurityGroupIngress": [
{
"IpProtocol": "-1",
"FromPort": "-1",
"ToPort": "-1",
"CidrIp": "0.0.0.0/0"
}
],
"SecurityGroupEgress": [
{
"IpProtocol": "-1",
"FromPort": "-1",
"ToPort": "-1",
"CidrIp": "0.0.0.0/0"
}
]
}
},
"WebServerGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": [
{
"Fn::GetAtt": [
"mySubnet",
"AvailabilityZone"
]
}
],
"LaunchConfigurationName": {
"Ref": "WebServerLaunchConfig"
},
"MinSize": "1",
"MaxSize": "10",
"DesiredCapacity": {
"Ref": "DesiredInstances"
}
}
},
"WebServerLaunchConfig": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"ImageId": "ami-xxxxx",
"InstanceType": {
"Ref": "InstanceType"
},
"KeyName": "xxxxxxxx",
"SecurityGroups": [
{
"Ref": "ec2Security"
}
]
}
}
}
Ich möchte in einer VPC mit Cloudformation mehr als eine Instanz in verschiedenen az starten.
Was ich hier falsch mache.
Vielen Dank.
ich den Code hinzugefügt haben, aber ich bin immer noch die gleichen Fehler gegenüber. –
Bitte posten Sie Ihren aktualisierten JSON hier –