我正在尝试以编程方式启动带有 EBS 的 Ubuntu 12.04 LTS Server 64 位。我编写了以下代码:
Placement placement = new Placement("eu-west-1b");
RunInstancesRequest runInstancesRequest = new RunInstancesRequest()
.withPlacement(placement).withInstanceType("t1.micro")
.withImageId("ami-c1aaabb5").withMinCount(1).withMaxCount(1)
.withSecurityGroupIds("testGroup").withKeyName("testKey")
.withUserData(Base64.encodeBase64String(startupScript.getBytes()));
RunInstancesResult runInstances = amazonEC2.runInstances(runInstancesRequest);
List<Instance> instances = runInstances.getReservation().getInstances();
但是,我收到此错误:
AWS 错误代码:InvalidAMIID.NotFound,AWS 错误消息:AMI ID 'ami-c1aaabb5' 不存在
我在 Amazon AWS 控制台和以下 URL 中找到了该实例 ID:http: //cloud-images.ubuntu.com/releases/precise/release-20121001/
我究竟做错了什么?