EasyManuals Logo

Amazon Redshift User Manual

Amazon Redshift
131 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #34 background imageLoading...
Page #34 background image
.getResourceAsStream("AwsCredentials.properties"));
client = new AmazonRedshiftClient(credentials);
try {
createClusterSubnetGroup();
describeClusterSubnetGroups();
modifyClusterSubnetGroup();
} catch (Exception e) {
System.err.println("Operation failed: " + e.getMessage());
}
}
private static void createClusterSubnetGroup() {
CreateClusterSubnetGroupRequest request = new CreateClusterSubnet
GroupRequest()
.withClusterSubnetGroupName(clusterSubnetGroupName)
.withDescription("my cluster subnet group")
.withSubnetIds(subnetId1);
client.createClusterSubnetGroup(request);
System.out.println("Created cluster subnet group: " + clusterSubnetGroup
Name);
}
private static void modifyClusterSubnetGroup() {
// Get existing subnet list.
DescribeClusterSubnetGroupsRequest request1 = new DescribeClusterSubnet
GroupsRequest()
.withClusterSubnetGroupName(clusterSubnetGroupName);
DescribeClusterSubnetGroupsResult result1 = client.describeClusterSub
netGroups(request1);
List<String> subnetNames = new ArrayList<String>();
// We can work with just the first group returned since we requested
info about one group.
for (Subnet subnet : result1.getClusterSubnetGroups().get(0).getSub
nets()) {
subnetNames.add(subnet.getSubnetIdentifier());
}
// Add to existing subnet list.
subnetNames.add(subnetId2);
ModifyClusterSubnetGroupRequest request = new ModifyClusterSubnet
GroupRequest()
.withClusterSubnetGroupName(clusterSubnetGroupName)
.withSubnetIds(subnetNames);
ClusterSubnetGroup result2 = client.modifyClusterSubnetGroup(request);
System.out.println("\nSubnet group modified.");
printResultSubnetGroup(result2);
}
private static void describeClusterSubnetGroups() {
DescribeClusterSubnetGroupsRequest request = new DescribeClusterSubnet
GroupsRequest()
.withClusterSubnetGroupName(clusterSubnetGroupName);
DescribeClusterSubnetGroupsResult result = client.describeClusterSubnet
API Version 2012-12-01
30
Amazon Redshift Management Guide
Cluster Subnet Groups

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Amazon Redshift and is the answer not in the manual?

Amazon Redshift Specifications

General IconGeneral
ProviderAmazon Web Services (AWS)
Query LanguageSQL
Data StorageColumnar storage
SecurityEncryption at rest and in transit, VPC, IAM
BackupAutomated and manual snapshots
DeploymentCloud-based
TypeCloud-based data warehouse service
Primary UseData warehousing, analytics
IntegrationIntegrates with AWS services, BI tools, and ETL tools
Pricing ModelOn-demand and reserved instance pricing
Data CompressionColumnar storage with data compression
Performance OptimizationQuery optimization

Related product manuals