Example usage for com.amazonaws.services.ec2 AmazonEC2 ENDPOINT_PREFIX

List of usage examples for com.amazonaws.services.ec2 AmazonEC2 ENDPOINT_PREFIX

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2 AmazonEC2 ENDPOINT_PREFIX.

Prototype

String ENDPOINT_PREFIX

To view the source code for com.amazonaws.services.ec2 AmazonEC2 ENDPOINT_PREFIX.

Click Source Link

Document

The region metadata service name for computing region endpoints.

Usage

From source file:jp.primecloud.auto.aws.amazon.AmazonAwsClientFactory.java

License:Open Source License

/**
 * {@inheritDoc}/*from  w w  w .jav  a 2 s .  c o  m*/
 */
@Override
public AmazonEC2 createEc2Client(String awsAccessId, String awsSecretKey) {
    AWSCredentials credentials = new BasicAWSCredentials(awsAccessId, awsSecretKey);
    ClientConfiguration configuration = createConfiguration();

    AmazonEC2 client = new AmazonEC2Client(credentials, configuration);

    if (host != null) {
        client.setEndpoint(AmazonEC2.ENDPOINT_PREFIX + "." + host);
    }

    client = new ExceptionHandleAwsClientWrapper().wrap(client);

    return client;
}