AWS实例创建错误

时间:2014-09-04 11:30:50

标签: amazon-web-services amazon-ec2 ec2-ami ec2-api-tools

我在通过eclipse在AWS中创建实例时遇到以下错误。

exception in thread "main" com.amazonaws.AmazonClientException: Unable to load AWS credentials from any provider in the chain
    at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:117)
    at com.amazonaws.services.opsworks.AWSOpsWorksClient.invoke(AWSOpsWorksClient.java:3574)
    at com.amazonaws.services.opsworks.AWSOpsWorksClient.createInstance(AWSOpsWorksClient.java:2098)
    at AwsConsoleApp.main(AwsConsoleApp.java:154)

我的代码是:

String az=new String("ec2.us-east-1.amazonaws.com");
cir.setAvailabilityZone(az);
String ami_id=new String("ami-864d84ee");
cir.setAmiId(ami_id);
CreateInstanceResult cr=awoc.createInstance(cir);
请告诉我这个。

1 个答案:

答案 0 :(得分:0)

您似乎需要提供凭据才能访问您的AWS账户:

http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/credentials.html