List of usage examples for com.amazonaws.services.rds AmazonRDSClient AmazonRDSClient
AmazonRDSClient(AwsSyncClientParams clientParams)
From source file:com.zotoh.cloudapi.aws.AWSCloud.java
License:Open Source License
private void createAWSClients(Properties ps) { AWSCredentials cc = new BasicAWSCredentials(ps.getProperty(P_ID), ps.getProperty(P_PWD)); AmazonWebServiceClient c;/*from www .j a v a2s.c o m*/ _WEB.put("ec2", new AmazonEC2Client(cc)); _WEB.put("s3", new AmazonS3Client(cc)); // SIMPLE-DB c = new AmazonSimpleDBClient(cc); _WEB.put("sdb", c); c.setEndpoint("sdb.amazonaws.com"); // LOAD BALANCER c = new AmazonElasticLoadBalancingClient(cc); _WEB.put("elb", c); c.setEndpoint("elasticloadbalancing.amazonaws.com"); _WEB.put("cloudwatch", new AmazonCloudWatchClient(cc)); _WEB.put("autoscale", new AmazonAutoScalingClient(cc)); // NOTIFICATION c = new AmazonSNSClient(cc); _WEB.put("sns", c); c.setEndpoint("sns.us-east-1.amazonaws.com"); _WEB.put("sqs", new AmazonSQSClient(cc)); _WEB.put("rds", new AmazonRDSClient(cc)); _WEB.put("s3s", new AmazonS3EncryptionClient(cc, new EncryptionMaterials((KeyPair) null))); }
From source file:fr.xebia.demo.amazon.aws.AmazonAwsInfrastructureMaker.java
License:Apache License
public AmazonAwsInfrastructureMaker() { try {/*from ww w .java2 s. c o m*/ InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("AwsCredentials.properties"); Preconditions.checkNotNull(credentialsAsStream, "File 'AwsCredentials.properties' NOT found in the classpath"); AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream); ec2 = new AmazonEC2Client(credentials); ec2.setEndpoint("ec2.eu-west-1.amazonaws.com"); rds = new AmazonRDSClient(credentials); rds.setEndpoint("rds.eu-west-1.amazonaws.com"); elb = new AmazonElasticLoadBalancingClient(credentials); elb.setEndpoint("elasticloadbalancing.eu-west-1.amazonaws.com"); } catch (IOException e) { throw Throwables.propagate(e); } }
From source file:fr.xebia.demo.amazon.aws.AmazonAwsShutdowner.java
License:Apache License
public AmazonAwsShutdowner() throws IOException { InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("AwsCredentials.properties"); Preconditions.checkNotNull(credentialsAsStream, "File 'AwsCredentials.properties' NOT found in the classpath"); AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream); ec2 = new AmazonEC2Client(credentials); ec2.setEndpoint("ec2.eu-west-1.amazonaws.com"); rds = new AmazonRDSClient(credentials); rds.setEndpoint("rds.eu-west-1.amazonaws.com"); elb = new AmazonElasticLoadBalancingClient(credentials); elb.setEndpoint("elasticloadbalancing.eu-west-1.amazonaws.com"); }
From source file:fr.xebia.demo.amazon.aws.PetclinicInfrastructureEnforcer.java
License:Apache License
public PetclinicInfrastructureEnforcer() { try {/*from w w w . j a v a2 s . c om*/ InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("AwsCredentials.properties"); Preconditions.checkNotNull(credentialsAsStream, "File 'AwsCredentials.properties' NOT found in the classpath"); AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream); ec2 = new AmazonEC2Client(credentials); ec2.setEndpoint("ec2.eu-west-1.amazonaws.com"); rds = new AmazonRDSClient(credentials); rds.setEndpoint("rds.eu-west-1.amazonaws.com"); elb = new AmazonElasticLoadBalancingClient(credentials); elb.setEndpoint("elasticloadbalancing.eu-west-1.amazonaws.com"); } catch (IOException e) { throw Throwables.propagate(e); } }
From source file:fr.xebia.training.troubleshooting.TroubleshootingTrainingInfrastructureCreator.java
License:Apache License
public TroubleshootingTrainingInfrastructureCreator() { try {//from w w w .j a v a 2 s . c o m InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("AwsCredentials.properties"); Preconditions.checkNotNull(credentialsAsStream, "File 'AwsCredentials.properties' NOT found in the classpath"); AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream); ec2 = new AmazonEC2Client(credentials); ec2.setEndpoint("ec2.eu-west-1.amazonaws.com"); rds = new AmazonRDSClient(credentials); rds.setEndpoint("rds.eu-west-1.amazonaws.com"); } catch (IOException e) { throw Throwables.propagate(e); } }
From source file:fr.xebia.workshop.infrastructureascode.AmazonAwsPetclinicInfrastructureEnforcer.java
License:Apache License
public AmazonAwsPetclinicInfrastructureEnforcer() { try {//w ww.j a v a2 s . c o m InputStream credentialsAsStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("AwsCredentials.properties"); Preconditions.checkNotNull(credentialsAsStream, "File 'AwsCredentials.properties' NOT found in the classpath"); AWSCredentials credentials = new PropertiesCredentials(credentialsAsStream); ec2 = new AmazonEC2Client(credentials); ec2.setEndpoint("ec2.eu-west-1.amazonaws.com"); rds = new AmazonRDSClient(credentials); rds.setEndpoint("rds.eu-west-1.amazonaws.com"); elb = new AmazonElasticLoadBalancingClient(credentials); elb.setEndpoint("elasticloadbalancing.eu-west-1.amazonaws.com"); } catch (IOException e) { throw Throwables.propagate(e); } }
From source file:io.macgyver.plugin.cloud.aws.scanner.RDSInstanceScanner.java
License:Apache License
private void forEachInstance(Region region, Consumer<DBInstance> consumer) { AmazonRDSClient client = new AmazonRDSClient(getAWSServiceClient().getCredentialsProvider()) .withRegion(region);// www.ja va2 s . c o m DescribeDBInstancesResult result = client.describeDBInstances(); String marker = result.getMarker(); result.getDBInstances().forEach(consumer); while (!Strings.isNullOrEmpty(marker) && !marker.equals("null")) { result = client.describeDBInstances().withMarker(marker); marker = result.getMarker(); result.getDBInstances().forEach(consumer); } }
From source file:org.cloudml.connectors.BeanstalkConnector.java
License:Open Source License
public BeanstalkConnector(String login, String pass, String region) { awsCredentials = new BasicAWSCredentials(login, pass); beanstalkClient = new AWSElasticBeanstalkClient(awsCredentials); this.beanstalkEndpoint = String.format("elasticbeanstalk.%s.amazonaws.com", region); beanstalkClient.setEndpoint(beanstalkEndpoint); this.rdsEndpoint = String.format("rds.%s.amazonaws.com", region); rdsClient = new AmazonRDSClient(awsCredentials); rdsClient.setEndpoint(rdsEndpoint);/*from w w w . j av a 2 s . c o m*/ this.sqsEndpoint = String.format("sqs.%s.amazonaws.com", region); sqsClient = new AmazonSQSAsyncClient(awsCredentials); sqsClient.setEndpoint(this.sqsEndpoint); }