Search in sources :

Example 21 with Region

use of software.amazon.awssdk.services.ec2.model.Region in project aws-doc-sdk-examples by awsdocs.

the class DescribeAddresses method main.

public static void main(String[] args) {
    Region region = Region.US_WEST_2;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    describeEC2Address(ec2);
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Example 22 with Region

use of software.amazon.awssdk.services.ec2.model.Region in project aws-doc-sdk-examples by awsdocs.

the class DescribeAccount method main.

public static void main(String[] args) {
    // Create an Ec2Client object
    Region region = Region.US_WEST_2;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    describeEC2Account(ec2);
    System.out.print("Done");
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Example 23 with Region

use of software.amazon.awssdk.services.ec2.model.Region in project aws-doc-sdk-examples by awsdocs.

the class DescribeInstanceTags method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "   <resourceId> \n\n" + "Where:\n" + "   resourceId - the instance ID value that you can obtain from the AWS Console (for example, i-xxxxxx0913e05f482). \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String resourceId = args[0];
    Region region = Region.US_EAST_1;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    describeEC2Tags(ec2, resourceId);
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Example 24 with Region

use of software.amazon.awssdk.services.ec2.model.Region in project aws-doc-sdk-examples by awsdocs.

the class DescribeKeyPairs method main.

public static void main(String[] args) {
    Region region = Region.US_WEST_2;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    describeEC2Keys(ec2);
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Example 25 with Region

use of software.amazon.awssdk.services.ec2.model.Region in project aws-doc-sdk-examples by awsdocs.

the class MonitorInstance method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "   <instanceId> <monitor>\n\n" + "Where:\n" + "   instanceId - an instance id value that you can obtain from the AWS Console. \n\n" + "   monitor - a monitoring status (true|false)";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String instanceId = args[0];
    boolean monitor = Boolean.valueOf(args[1]);
    Region region = Region.US_WEST_2;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    if (monitor) {
        monitorInstance(ec2, instanceId);
    } else {
        unmonitorInstance(ec2, instanceId);
    }
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Aggregations

Region (software.amazon.awssdk.regions.Region)20 Ec2Client (software.amazon.awssdk.services.ec2.Ec2Client)20 AmazonClientException (com.amazonaws.AmazonClientException)3 AmazonServiceException (com.amazonaws.AmazonServiceException)3 DescribeRegionsResult (com.amazonaws.services.ec2.model.DescribeRegionsResult)3 Region (com.amazonaws.services.ec2.model.Region)3 Region (com.amazonaws.services.s3.model.Region)3 TransferManager (com.amazonaws.services.s3.transfer.TransferManager)3 IOException (java.io.IOException)3 Date (java.util.Date)3 DataStoreException (org.apache.jackrabbit.core.data.DataStoreException)3 NamedThreadFactory (org.apache.jackrabbit.core.data.util.NamedThreadFactory)3 Regions (com.amazonaws.regions.Regions)2 AmazonEC2 (com.amazonaws.services.ec2.AmazonEC2)2 Map (java.util.Map)2 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)2 AsyncHandler (com.amazonaws.handlers.AsyncHandler)1 AvailabilityZone (com.amazonaws.services.ec2.model.AvailabilityZone)1 DescribeAvailabilityZonesResult (com.amazonaws.services.ec2.model.DescribeAvailabilityZonesResult)1 DescribeRegionsRequest (com.amazonaws.services.ec2.model.DescribeRegionsRequest)1