EasyManuals Logo
Home>Amazon>Software>Redshift

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 #43 background imageLoading...
Page #43 background image
}
// Add new security group to the list.
secGroupNames.add(clusterSecurityGroupName);
// Apply the change to the cluster.
ModifyClusterRequest request2 = new ModifyClusterRequest()
.withClusterIdentifier(clusterIdentifier)
.withClusterSecurityGroups(secGroupNames);
Cluster result2 = client.modifyCluster(request2);
System.out.format("\nAssociated security group '%s' to cluster '%s'.",
clusterSecurityGroupName, clusterIdentifier);
}
private static void describeClusterSecurityGroups() {
DescribeClusterSecurityGroupsRequest request = new DescribeClusterSecur
ityGroupsRequest();
DescribeClusterSecurityGroupsResult result = client.describeClusterSe
curityGroups(request);
printResultSecurityGroups(result.getClusterSecurityGroups());
}
private static void printResultSecurityGroups(List<ClusterSecurityGroup>
groups)
{
if (groups == null)
{
System.out.println("\nDescribe cluster security groups result is
null.");
return;
}
System.out.println("\nPrinting security group results:");
for (ClusterSecurityGroup group : groups)
{
printResultSecurityGroup(group);
}
}
private static void printResultSecurityGroup(ClusterSecurityGroup group) {
System.out.format("\nName: '%s', Description: '%s'\n",
group.getClusterSecurityGroupName(), group.getDescription());
for (EC2SecurityGroup g : group.getEC2SecurityGroups()) {
System.out.format("EC2group: '%s', '%s', '%s'\n", g.getEC2Security
GroupName(), g.getEC2SecurityGroupOwnerId(), g.getStatus());
}
for (IPRange range : group.getIPRanges()) {
System.out.format("IPRanges: '%s', '%s'\n", range.getCIDRIP(),
range.getStatus());
}
}
}
API Version 2012-12-01
39
Amazon Redshift Management Guide
Managing Security Groups Using AWS SDK for Java

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
BrandAmazon
ModelRedshift
CategorySoftware
LanguageEnglish

Related product manuals