Search in sources :

Example 6 with Region

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

the class CreateKeyPair method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "   <keyName> \n\n" + "Where:\n" + "   keyName - a key pair name (for example, TestKeyPair). \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String keyName = args[0];
    Region region = Region.US_WEST_2;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    createEC2KeyPair(ec2, keyName);
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Example 7 with Region

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

the class DeleteKeyPair method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "   <keyPair> \n\n" + "Where:\n" + "   keyPair - a key pair name (for example, TestKeyPair).";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String keyPair = args[0];
    Region region = Region.US_WEST_2;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    deleteKeys(ec2, keyPair);
    ec2.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) Ec2Client(software.amazon.awssdk.services.ec2.Ec2Client)

Example 8 with Region

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

the class DescribeReservedInstances method main.

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

Example 9 with Region

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

the class DescribeVPCs method main.

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

Example 10 with Region

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

the class AllocateAddress method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <instanceId>\n\n" + "Where:\n" + "    instanceId - an instance id value that you can obtain from the AWS Console. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String instanceId = args[0];
    Region region = Region.US_EAST_1;
    Ec2Client ec2 = Ec2Client.builder().region(region).build();
    System.out.println(getAllocateAddress(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