Search in sources :

Example 86 with Region

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

the class ListEventBuses method main.

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

Example 87 with Region

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

the class ListDeliveryStreams method main.

public static void main(String[] args) throws Exception {
    Region region = Region.US_EAST_1;
    FirehoseClient firehoseClient = FirehoseClient.builder().region(region).build();
    listStreams(firehoseClient);
    firehoseClient.close();
}
Also used : FirehoseClient(software.amazon.awssdk.services.firehose.FirehoseClient) Region(software.amazon.awssdk.regions.Region)

Example 88 with Region

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

the class UpdateService method main.

public static void main(String[] args) {
    final String usage = "\n" + "Usage:\n" + "  UpdateService " + "   <clusterName> <serviceArn> \n\n" + "Where:\n" + "  clusterName - the cluster name.\n" + "  serviceArn - the service ARN value.\n";
    if (args.length != 2) {
        System.out.println(usage);
        System.exit(1);
    }
    String clusterName = args[0];
    String serviceArn = args[1];
    Region region = Region.US_EAST_1;
    EcsClient ecsClient = EcsClient.builder().region(region).build();
    updateSpecificService(ecsClient, clusterName, serviceArn);
    ecsClient.close();
}
Also used : Region(software.amazon.awssdk.regions.Region) EcsClient(software.amazon.awssdk.services.ecs.EcsClient)

Example 89 with Region

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

the class ListTables method main.

public static void main(String[] args) {
    System.out.println("Your Amazon DynamoDB tables:\n");
    Region region = Region.US_EAST_1;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    listAllTables(ddb);
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region)

Example 90 with Region

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

the class PutItemEncrypt method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    PutItem <tableName> <key> <keyVal> <albumtitle> <albumtitleval> <awards> <awardsval> <Songtitle> <songtitleval>\n\n" + "Where:\n" + "    tableName - the Amazon DynamoDB table in which an item is placed (for example, Music3).\n" + "    key - the key used in the Amazon DynamoDB table (for example, Artist).\n" + "    keyval - the key value that represents the item to get (for example, Famous Band).\n" + "    albumTitle - album title (for example, AlbumTitle).\n" + "    AlbumTitleValue - the name of the album (for example, Songs About Life ).\n" + "    Awards - the awards column (for example, Awards).\n" + "    AwardVal - the value of the awards (for example, 10).\n" + "    SongTitle - the song title (for example, SongTitle).\n" + "    SongTitleVal - the value of the song title (for example, Happy Day).\n" + "    keyId - a KMS key id value to use to encrypt/decrypt the data (for example, xxxxxbcd-12ab-34cd-56ef-1234567890ab).";
    if (args.length != 10) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String tableName = args[0];
    String key = args[1];
    String keyVal = args[2];
    String albumTitle = args[3];
    String albumTitleValue = args[4];
    String awards = args[5];
    String awardVal = args[6];
    String songTitle = args[7];
    String songTitleVal = args[8];
    String keyId = args[9];
    Region region = Region.US_WEST_2;
    DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
    // Create a KmsClient object to use to encrpt data
    KmsClient kmsClient = KmsClient.builder().region(region).build();
    putItemInTable(ddb, kmsClient, tableName, key, keyVal, albumTitle, albumTitleValue, awards, awardVal, songTitle, songTitleVal, keyId);
    System.out.println("Done!");
    ddb.close();
}
Also used : DynamoDbClient(software.amazon.awssdk.services.dynamodb.DynamoDbClient) Region(software.amazon.awssdk.regions.Region) KmsClient(software.amazon.awssdk.services.kms.KmsClient)

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