Search in sources :

Example 96 with Region

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

the class CreateCluster method main.

public static void main(String[] args) {
    final String usage = "\n" + "Usage: " + "   <jar> <myClass> <keys> <logUri> <name>\n\n" + "Where:\n" + "   jar - a path to a JAR file run during the step. \n\n" + "   myClass - the name of the main class in the specified Java file. \n\n" + "   keys - The name of the Amazon EC2 key pair. \n\n" + "   logUri - The Amazon S3 bucket where the logs are located (for example,  s3://<BucketName>/logs/). \n\n" + "   name - The name of the job flow. \n\n";
    if (args.length != 5) {
        System.out.println(usage);
        System.exit(1);
    }
    String jar = args[0];
    String myClass = args[1];
    String keys = args[2];
    String logUri = args[3];
    String name = args[4];
    Region region = Region.US_WEST_2;
    EmrClient emrClient = EmrClient.builder().region(region).build();
    String jobFlowId = createAppCluster(emrClient, jar, myClass, keys, logUri, name);
    System.out.println("The job flow id is " + jobFlowId);
    emrClient.close();
}
Also used : EmrClient(software.amazon.awssdk.services.emr.EmrClient) Region(software.amazon.awssdk.regions.Region)

Example 97 with Region

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

the class ListForecasts method main.

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

Example 98 with Region

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

the class GetDatabases method main.

public static void main(String[] args) {
    Region region = Region.US_EAST_1;
    GlueClient glueClient = GlueClient.builder().region(region).build();
    getAllDatabases(glueClient);
    glueClient.close();
}
Also used : GlueClient(software.amazon.awssdk.services.glue.GlueClient) Region(software.amazon.awssdk.regions.Region)

Example 99 with Region

use of software.amazon.awssdk.regions.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 100 with Region

use of software.amazon.awssdk.regions.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)

Aggregations

Region (software.amazon.awssdk.regions.Region)534 S3Client (software.amazon.awssdk.services.s3.S3Client)43 RekognitionClient (software.amazon.awssdk.services.rekognition.RekognitionClient)32 DynamoDbClient (software.amazon.awssdk.services.dynamodb.DynamoDbClient)31 IamClient (software.amazon.awssdk.services.iam.IamClient)23 PersonalizeClient (software.amazon.awssdk.services.personalize.PersonalizeClient)22 Ec2Client (software.amazon.awssdk.services.ec2.Ec2Client)20 Test (org.junit.Test)17 AwsCredentialsProvider (software.amazon.awssdk.auth.credentials.AwsCredentialsProvider)15 KmsClient (software.amazon.awssdk.services.kms.KmsClient)15 URI (java.net.URI)13 CodeCommitClient (software.amazon.awssdk.services.codecommit.CodeCommitClient)13 GlueClient (software.amazon.awssdk.services.glue.GlueClient)12 Properties (java.util.Properties)11 DynamoDbEnhancedClient (software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient)11 SesClient (software.amazon.awssdk.services.ses.SesClient)11 SdkBytes (software.amazon.awssdk.core.SdkBytes)9 Route53Client (software.amazon.awssdk.services.route53.Route53Client)9 CloudTrailClient (software.amazon.awssdk.services.cloudtrail.CloudTrailClient)8 CloudWatchClient (software.amazon.awssdk.services.cloudwatch.CloudWatchClient)8