List of usage examples for com.amazonaws.auth.profile ProfileCredentialsProvider ProfileCredentialsProvider
public ProfileCredentialsProvider(String profileName)
From source file:tools.descartes.bungee.cloud.aws.AWSImpl.java
License:Apache License
private void init() { AWSCredentials credentials = null;//from w w w .j a v a2 s . c om try { credentials = new ProfileCredentialsProvider("default").getCredentials(); } catch (Exception e) { throw new AmazonClientException("Cannot load the credentials from the credential profiles file. " + "Please make sure that your credentials file is at the correct " + "location (C:\\Users\\<Username>\\.aws\\credentials), and is in valid format.", e); } elasticLB = new AmazonElasticLoadBalancingClient(credentials); elasticLB.setEndpoint(LB_END_POINT_NAME); ec2 = new AmazonEC2Client(credentials); ec2.setEndpoint(EC2_END_POINT_NAME); autoScale = new AmazonAutoScalingClient(credentials); autoScale.setEndpoint(AUTOSCALING_END_POINT_NAME); }