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