2017-02-16 74 views

回答

2

您可以使用AWSLambdaClientBuilder

BasicAWSCredentials creds = new BasicAWSCredentials("access_key", "secret_key"); 
AWSLambda lClient = AmazonLambdaClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(creds)).build(); 
+0

@ViswanathAlikonda什麼是SDK的版本? – franklinsijo

+0

java.lang.NoSuchMethodError:com.amazonaws.util.StringUtils.trim(Ljava/lang/String;)Ljava/lang/String; 在com.amazonaws.auth.profile.internal.AwsProfileNameLoader.getEnvProfileName(AwsProfileNameLoader.java:72) 在com.amazonaws.auth.profile.internal.AwsProfileNameLoader.loadProfileName(AwsProfileNameLoader.java:54) 在com.amazonaws。 regions.AwsProfileRegionProvider。 (AwsProfileRegionProvider.java:40) at com.amazonaws.regions.DefaultAwsRegionProviderChain。 (DefaultAwsRegionProviderChain.java:23) at com.amazonaws.client.builder.AwsClientBuilder。 (AwsClientBuilder.java:58) –

+0

AWS SDK版本1.11.87 –