use of com.amazonaws.services.ec2.AmazonEC2ClientBuilder in project photon-model by vmware.
the class TestUtils method getEC2SynchronousClient.
public static AmazonEC2 getEC2SynchronousClient(AuthCredentialsServiceState credentials, String region) {
ClientConfiguration configuration = AWSUtils.createClientConfiguration();
AWSStaticCredentialsProvider awsStaticCredentialsProvider = new AWSStaticCredentialsProvider(new BasicAWSCredentials(credentials.privateKeyId, EncryptionUtils.decrypt(credentials.privateKey)));
AmazonEC2ClientBuilder ec2ClientBuilder = AmazonEC2ClientBuilder.standard().withCredentials(awsStaticCredentialsProvider).withRegion(region).withClientConfiguration(configuration);
return ec2ClientBuilder.build();
}
Aggregations