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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations