Example usage for com.amazonaws.services.rds.model RevokeDBSecurityGroupIngressRequest setEC2SecurityGroupOwnerId

List of usage examples for com.amazonaws.services.rds.model RevokeDBSecurityGroupIngressRequest setEC2SecurityGroupOwnerId

Introduction

In this page you can find the example usage for com.amazonaws.services.rds.model RevokeDBSecurityGroupIngressRequest setEC2SecurityGroupOwnerId.

Prototype


public void setEC2SecurityGroupOwnerId(String eC2SecurityGroupOwnerId) 

Source Link

Document

The AWS account number of the owner of the EC2 security group specified in the EC2SecurityGroupName parameter.

Usage

From source file:org.cloudml.connectors.BeanstalkConnector.java

License:Open Source License

/**
 * Not used yet!//from  ww  w  .  ja va 2 s.c o m
 *
 * @param dbInstanceIdentifier
 * @param group
 * @param owner
 */
public void setSecuretGroup(String dbInstanceIdentifier, String group, String owner) {

    String groupName = dbInstanceIdentifier + "-security-group";
    CreateDBSecurityGroupRequest csg = new CreateDBSecurityGroupRequest();
    csg.setDBSecurityGroupName(groupName);
    csg.setDBSecurityGroupDescription(groupName);
    rdsClient.createDBSecurityGroup(csg);

    RevokeDBSecurityGroupIngressRequest rsgi = new RevokeDBSecurityGroupIngressRequest();
    rsgi.setDBSecurityGroupName(groupName);
    rsgi.setEC2SecurityGroupId(group);
    rsgi.setEC2SecurityGroupOwnerId(owner);
    rsgi.setRequestCredentials(awsCredentials);
    //rsgi.set
    rdsClient.revokeDBSecurityGroupIngress(rsgi);

    ModifyDBInstanceRequest request = new ModifyDBInstanceRequest();
    Collection<String> groups = new ArrayList();
    groups.add(groupName);
    request.setDBSecurityGroups(groups);
    request.setDBInstanceIdentifier(dbInstanceIdentifier);
    rdsClient.modifyDBInstance(request);

}