InstanceNetworkInterfaceSpecification vpc = new InstanceNetworkInterfaceSpecification()
{
SubnetId = "subnet-sadfsadf",
AssociatePublicIpAddress = true,
DeleteOnTermination = false
};
List<InstanceNetworkInterfaceSpecification> temp= new List<InstanceNetworkInterfaceSpecification>();
temp.Add(vpc);
//Create and initialize a RunInstanceRequest
RunInstancesRequest newInstanceRequest = new RunInstancesRequest()
{
ImageId = appdbAMI,
InstanceType = appdbType,
MinCount = 1,
MaxCount = appdbQuantity,
KeyName = ec2Key,
NetworkInsterfaces = temp,
BlockDeviceMappings = resp.Images[0].BlockDeviceMappings
//DisableApiTermination = true
};
这不会将实例启动到具有公共IP地址的vpc中。它有什么问题?我想启动一个实例到一个vpc中,该vpc也分配一个公共ip地址。将EC2实例启动到vpc中并使用公共IP
它是做什么的?你能提供一些日志吗? – Rico
谢谢!我总是忘记检查我的日志!我会发布我现在只是为了将来参考。 – swiftie
您可以将您的解决方案添加为答案吗? – Rico