Example usage for com.amazonaws.services.ec2 AmazonEC2AsyncClient setRegion

List of usage examples for com.amazonaws.services.ec2 AmazonEC2AsyncClient setRegion

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2 AmazonEC2AsyncClient setRegion.

Prototype

@Deprecated
void setRegion(com.amazonaws.regions.Region region);

Source Link

Document

An alternative to AmazonEC2#setEndpoint(String) , sets the regional endpoint for this client's service calls.

Usage

From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSUtils.java

License:Open Source License

public static AmazonEC2AsyncClient getAsyncClient(AuthCredentialsServiceState credentials, String region,
        ExecutorService executorService) {
    AmazonEC2AsyncClient ec2AsyncClient = new AmazonEC2AsyncClient(
            new BasicAWSCredentials(credentials.privateKeyId, credentials.privateKey), executorService);

    ec2AsyncClient.setRegion(Region.getRegion(Regions.fromName(region)));

    return ec2AsyncClient;

}