Search in sources :

Example 21 with Region

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

the class CreateTable method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <tableName> <key>\n\n" + "Where:\n" + "    tableName - the Amazon DynamoDB table to create (for example, Music3).\n\n" + "    key - the key for the Amazon DynamoDB table (for example, Artist).\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String tableName = args[0];
    String key = args[1];
    System.out.format("Creating an Amazon DynamoDB table \"%s\" with a simple primary key: \"Name\".\n", tableName);
    Region region = Region.US_EAST_1;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    String result = createTable(ddb, tableName, key);
    System.out.println("New table is " + result);
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region)

Example 22 with Region

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

the class DeleteTable method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <tableName>\n\n" + "Where:\n" + "    tableName - the Amazon DynamoDB table to delete (for example, Music3).\n\n" + "**Warning** This program will delete the table that you specify!\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    // Read the command line argument
    String tableName = args[0];
    System.out.format("Deleting the Amazon DynamoDB table %s...\n", tableName);
    // Create the DynamoDbClient object
    Region region = Region.US_EAST_1;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    deleteDynamoDBTable(ddb, tableName);
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region)

Example 23 with Region

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

the class DynamoDBScanItems method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <tableName>\n\n" + "Where:\n" + "    tableName - the Amazon DynamoDB table to get information from (for example, Music3).\n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String tableName = args[0];
    Region region = Region.US_EAST_1;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    scanItems(ddb, tableName);
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region)

Example 24 with Region

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

the class DetectLanguage method main.

public static void main(String[] args) {
    // Specify French text - "It is raining today in Seattle"
    String text = "Il pleut aujourd'hui à Seattle";
    Region region = Region.US_EAST_1;
    ComprehendClient comClient = ComprehendClient.builder().region(region).build();
    System.out.println("Calling DetectDominantLanguage");
    detectTheDominantLanguage(comClient, text);
    comClient.close();
}
Also used : ComprehendClient(software.amazon.awssdk.services.comprehend.ComprehendClient) Region(software.amazon.awssdk.regions.Region)

Example 25 with Region

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

the class DetectSyntax method main.

public static void main(String[] args) {
    String text = "Amazon.com, Inc. is located in Seattle, WA and was founded July 5th, 1994 by Jeff Bezos, allowing customers to buy everything from books to blenders. Seattle is north of Portland and south of Vancouver, BC. Other notable Seattle - based companies are Starbucks and Boeing.";
    Region region = Region.US_EAST_1;
    ComprehendClient comClient = ComprehendClient.builder().region(region).build();
    System.out.println("Calling DetectSyntax");
    detectAllSyntax(comClient, text);
    comClient.close();
}
Also used : ComprehendClient(software.amazon.awssdk.services.comprehend.ComprehendClient) Region(software.amazon.awssdk.regions.Region)

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