我正在尝试编写程序以启动一个带有EBS的64位Ubuntu 12.04 LTS服务器。以下是我的代码:
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/ 我做错了什么?我该如何正确操作?