Example usage for com.amazonaws.services.cloudwatch AmazonCloudWatchClient builder

List of usage examples for com.amazonaws.services.cloudwatch AmazonCloudWatchClient builder

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudwatch AmazonCloudWatchClient builder.

Prototype

public static AmazonCloudWatchClientBuilder builder() 

Source Link

Usage

From source file:com.netflix.edda.AwsClientFactory.java

License:Apache License

public static AmazonCloudWatch newCloudWatchClient(AwsConfiguration config, AWSCredentialsProvider provider,
        String vip, String region) {
    if (config.useMock())
        throw new UnsupportedOperationException("CloudWatch mock not yet supported");

    EddaCloudWatchClient edda = new EddaCloudWatchClient(config, vip, region);

    if (config.useEdda() && !config.wrapAwsClient())
        return edda.readOnly();

    AmazonCloudWatch client = AmazonCloudWatchClient.builder().withCredentials(provider)
            .withClientConfiguration(clientConfig(config)).withRegion(region).build();
    if (config.useEdda())
        client = edda.wrapAwsClient(client);
    return client;
}