@Bean public AmazonAutoScaling amazonAutoScalingClient(final AWSCredentialsProvider awsCredentialsProvider, final ClientConfiguration awsClientConfig, final Region awsRegion) { return AmazonAutoScalingClientBuilder.standard() .withCredentials(awsCredentialsProvider) .withClientConfiguration(awsClientConfig) .withRegion(awsRegion.getName()) .build(); }
public AutoScaling(AWSCredentialsProvider credentials, Regions region) { autoScaling = AmazonAutoScalingClientBuilder.standard().withRegion(region).withCredentials(credentials).build(); }
/** * Constructs a new {@link AutoScalingApiClient} that operates against a * given AWS region. * * @param awsCredentials * The AWS credentials used to connect to the AWS account. * @param region * The AWS region that this client operates against. * @param clientConfiguration * Any HTTP client configuration to customize API invocations. */ public AutoScalingApiClient(AWSCredentials awsCredentials, String region, ClientConfiguration clientConfiguration) { // limit the time-to-live of the JVM's DNS cache (in seconds) java.security.Security.setProperty("networkaddress.cache.ttl", "60"); this.region = region; this.api = AmazonAutoScalingClientBuilder.standard().withRegion(region) .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build(); }