【发布时间】:2014-05-15 18:19:43
【问题描述】:
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 中启动一个实例,并为其分配一个公共 IP 地址。
【问题讨论】:
-
它有什么作用?你能提供一些日志吗?
-
谢谢!我总是忘记检查我的日志!我将发布我现在拥有的内容以供将来参考。
-
您可以添加您的解决方案作为答案吗?
标签: c# amazon-web-services amazon-ec2 ip amazon-vpc