/** * Constructs a new ModifyDBInstanceRequest object. Callers should use the setter or fluent setter (with...) methods * to initialize any additional object members. * * @param dBInstanceIdentifier * The DB instance identifier. This value is stored as a lowercase string.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must match the identifier of an existing DBInstance. * </p> * </li> */ public ModifyDBInstanceRequest(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); }
setApplyImmediately(applyImmediately); return this;
setDBSecurityGroups(dBSecurityGroups); return this;
hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getAllocatedStorage() == null) ? 0 : getAllocatedStorage().hashCode()); hashCode = prime * hashCode + ((getDBInstanceClass() == null) ? 0 : getDBInstanceClass().hashCode()); hashCode = prime * hashCode + ((getDBSubnetGroupName() == null) ? 0 : getDBSubnetGroupName().hashCode()); hashCode = prime * hashCode + ((getDBSecurityGroups() == null) ? 0 : getDBSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getVpcSecurityGroupIds() == null) ? 0 : getVpcSecurityGroupIds().hashCode()); hashCode = prime * hashCode + ((getApplyImmediately() == null) ? 0 : getApplyImmediately().hashCode()); hashCode = prime * hashCode + ((getMasterUserPassword() == null) ? 0 : getMasterUserPassword().hashCode()); hashCode = prime * hashCode + ((getDBParameterGroupName() == null) ? 0 : getDBParameterGroupName().hashCode()); hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode()); hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode()); hashCode = prime * hashCode + ((getPreferredMaintenanceWindow() == null) ? 0 : getPreferredMaintenanceWindow().hashCode()); hashCode = prime * hashCode + ((getMultiAZ() == null) ? 0 : getMultiAZ().hashCode()); hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode()); hashCode = prime * hashCode + ((getAllowMajorVersionUpgrade() == null) ? 0 : getAllowMajorVersionUpgrade().hashCode()); hashCode = prime * hashCode + ((getAutoMinorVersionUpgrade() == null) ? 0 : getAutoMinorVersionUpgrade().hashCode()); hashCode = prime * hashCode + ((getLicenseModel() == null) ? 0 : getLicenseModel().hashCode()); hashCode = prime * hashCode + ((getIops() == null) ? 0 : getIops().hashCode()); hashCode = prime * hashCode + ((getOptionGroupName() == null) ? 0 : getOptionGroupName().hashCode()); hashCode = prime * hashCode + ((getNewDBInstanceIdentifier() == null) ? 0 : getNewDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getStorageType() == null) ? 0 : getStorageType().hashCode()); hashCode = prime * hashCode + ((getTdeCredentialArn() == null) ? 0 : getTdeCredentialArn().hashCode()); hashCode = prime * hashCode + ((getTdeCredentialPassword() == null) ? 0 : getTdeCredentialPassword().hashCode()); hashCode = prime * hashCode + ((getCACertificateIdentifier() == null) ? 0 : getCACertificateIdentifier().hashCode()); hashCode = prime * hashCode + ((getDomain() == null) ? 0 : getDomain().hashCode()); hashCode = prime * hashCode + ((getCopyTagsToSnapshot() == null) ? 0 : getCopyTagsToSnapshot().hashCode()); hashCode = prime * hashCode + ((getMonitoringInterval() == null) ? 0 : getMonitoringInterval().hashCode()); hashCode = prime * hashCode + ((getDBPortNumber() == null) ? 0 : getDBPortNumber().hashCode()); hashCode = prime * hashCode + ((getPubliclyAccessible() == null) ? 0 : getPubliclyAccessible().hashCode());
private void modifyDBInstance(AmazonRDS rds) { // to enable conventionMappings feature String dbInstanceIdentifier = getDbInstanceIdentifier(); if (dbInstanceIdentifier == null) { throw new GradleException("dbInstanceIdentifier is required"); } ModifyDBInstanceRequest request = new ModifyDBInstanceRequest() .withDBInstanceIdentifier(dbInstanceIdentifier) .withAllocatedStorage(getAllocatedStorage()) .withDBInstanceClass(getDbInstanceClass()) .withMasterUserPassword(getMasterUserPassword()) .withVpcSecurityGroupIds(getVpcSecurityGroupIds()) .withPreferredMaintenanceWindow(getPreferredMaintenanceWindow()) .withDBParameterGroupName(getDbParameterGroupName()) .withBackupRetentionPeriod(getBackupRetentionPeriod()) .withPreferredBackupWindow(getPreferredBackupWindow()) .withMultiAZ(getMultiAZ()) .withEngineVersion(getEngineVersion()) .withAutoMinorVersionUpgrade(getAutoMinorVersionUpgrade()) .withIops(getIops()) .withOptionGroupName(getOptionGroupName()) .withStorageType(getStorageType()) .withTdeCredentialArn(getTdeCredentialArn()) .withTdeCredentialPassword(getTdeCredentialPassword()); dbInstance = rds.modifyDBInstance(request); getLogger().info("Modify RDS instance requested: {}", dbInstance.getDBInstanceIdentifier()); } }
@Override public FixResult executeFix(Map<String, String> issue, Map<String, Object> clientMap, Map<String, String> ruleParams) { String dbInstanceIdentifier = issue.get(PacmanSdkConstants.RESOURCE_ID); AmazonRDS amazonRdsClient = (AmazonRDSClient) clientMap.get(PacmanSdkConstants.CLIENT); ModifyDBInstanceRequest modifyDBInstanceRequest = new ModifyDBInstanceRequest(); modifyDBInstanceRequest.setDBInstanceIdentifier(dbInstanceIdentifier); modifyDBInstanceRequest.setApplyImmediately(Boolean.FALSE); modifyDBInstanceRequest.setPubliclyAccessible(Boolean.FALSE); amazonRdsClient.modifyDBInstance(modifyDBInstanceRequest); return new FixResult(PacmanSdkConstants.STATUS_SUCCESS_CODE, "the rds db instance is now fixed"); }
.withDBSecurityGroupName(groupName) ); ModifyDBInstanceRequest request = new ModifyDBInstanceRequest(); Collection<String> groups = new ArrayList(); groups.add(groupName); request.setDBSecurityGroups(groups); request.setDBInstanceIdentifier(dbInstanceIdentifier); System.out.print("Modifying security group"); while(timeout-->0){
setPubliclyAccessible(publiclyAccessible); return this;
return false; ModifyDBInstanceRequest other = (ModifyDBInstanceRequest) obj; if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false; if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false; if (other.getAllocatedStorage() == null ^ this.getAllocatedStorage() == null) return false; if (other.getAllocatedStorage() != null && other.getAllocatedStorage().equals(this.getAllocatedStorage()) == false) return false; if (other.getDBInstanceClass() == null ^ this.getDBInstanceClass() == null) return false; if (other.getDBInstanceClass() != null && other.getDBInstanceClass().equals(this.getDBInstanceClass()) == false) return false; if (other.getDBSubnetGroupName() == null ^ this.getDBSubnetGroupName() == null) return false; if (other.getDBSubnetGroupName() != null && other.getDBSubnetGroupName().equals(this.getDBSubnetGroupName()) == false) return false; if (other.getDBSecurityGroups() == null ^ this.getDBSecurityGroups() == null) return false; if (other.getDBSecurityGroups() != null && other.getDBSecurityGroups().equals(this.getDBSecurityGroups()) == false) return false; if (other.getVpcSecurityGroupIds() == null ^ this.getVpcSecurityGroupIds() == null) return false; if (other.getVpcSecurityGroupIds() != null && other.getVpcSecurityGroupIds().equals(this.getVpcSecurityGroupIds()) == false) return false; if (other.getApplyImmediately() == null ^ this.getApplyImmediately() == null) return false; if (other.getApplyImmediately() != null && other.getApplyImmediately().equals(this.getApplyImmediately()) == false)
AmazonRDS rds = ext.getClient(); ModifyDBInstanceRequest request = new ModifyDBInstanceRequest() .withDBInstanceIdentifier(dbInstanceIdentifier) .withAllocatedStorage(getAllocatedStorage()) .withDBInstanceClass(getDbInstanceClass()) .withMasterUserPassword(getMasterUserPassword()) .withVpcSecurityGroupIds(getVpcSecurityGroupIds()) .withPreferredMaintenanceWindow(getPreferredMaintenanceWindow()) .withDBParameterGroupName(getDbParameterGroupName()) .withBackupRetentionPeriod(getBackupRetentionPeriod()) .withPreferredBackupWindow(getPreferredBackupWindow()) .withMultiAZ(getMultiAZ()) .withEngineVersion(getEngineVersion()) .withAutoMinorVersionUpgrade(getAutoMinorVersionUpgrade()) .withIops(getIops()) .withOptionGroupName(getOptionGroupName()) .withStorageType(getStorageType()) .withTdeCredentialArn(getTdeCredentialArn()) .withTdeCredentialPassword(getTdeCredentialPassword()); dbInstance = rds.modifyDBInstance(request); getLogger().info("Modify RDS instance requested: {}", dbInstance.getDBInstanceIdentifier());
/** * Not used yet! * * @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); }
setPubliclyAccessible(publiclyAccessible); return this;
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(","); if (getAllocatedStorage() != null) sb.append("AllocatedStorage: ").append(getAllocatedStorage()).append(","); if (getDBInstanceClass() != null) sb.append("DBInstanceClass: ").append(getDBInstanceClass()).append(","); if (getDBSubnetGroupName() != null) sb.append("DBSubnetGroupName: ").append(getDBSubnetGroupName()).append(","); if (getDBSecurityGroups() != null) sb.append("DBSecurityGroups: ").append(getDBSecurityGroups()).append(","); if (getVpcSecurityGroupIds() != null) sb.append("VpcSecurityGroupIds: ").append(getVpcSecurityGroupIds()).append(","); if (getApplyImmediately() != null) sb.append("ApplyImmediately: ").append(getApplyImmediately()).append(","); if (getMasterUserPassword() != null) sb.append("MasterUserPassword: ").append(getMasterUserPassword()).append(","); if (getDBParameterGroupName() != null) sb.append("DBParameterGroupName: ").append(getDBParameterGroupName()).append(","); if (getBackupRetentionPeriod() != null) sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(","); if (getPreferredBackupWindow() != null) sb.append("PreferredBackupWindow: ").append(getPreferredBackupWindow()).append(","); if (getPreferredMaintenanceWindow() != null) sb.append("PreferredMaintenanceWindow: ").append(getPreferredMaintenanceWindow()).append(","); if (getMultiAZ() != null) sb.append("MultiAZ: ").append(getMultiAZ()).append(","); if (getEngineVersion() != null)
setDBInstanceIdentifier(dBInstanceIdentifier); return this;
setDBSecurityGroups(new com.amazonaws.internal.SdkInternalList<String>(dBSecurityGroups.length));
setApplyImmediately(applyImmediately); return this;
if (modifyDBInstanceRequest.getDBInstanceIdentifier() != null) { request.addParameter("DBInstanceIdentifier", StringUtils.fromString(modifyDBInstanceRequest.getDBInstanceIdentifier())); if (modifyDBInstanceRequest.getAllocatedStorage() != null) { request.addParameter("AllocatedStorage", StringUtils.fromInteger(modifyDBInstanceRequest.getAllocatedStorage())); if (modifyDBInstanceRequest.getDBInstanceClass() != null) { request.addParameter("DBInstanceClass", StringUtils.fromString(modifyDBInstanceRequest.getDBInstanceClass())); if (modifyDBInstanceRequest.getDBSubnetGroupName() != null) { request.addParameter("DBSubnetGroupName", StringUtils.fromString(modifyDBInstanceRequest.getDBSubnetGroupName())); if (!modifyDBInstanceRequest.getDBSecurityGroups().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) modifyDBInstanceRequest.getDBSecurityGroups()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> dBSecurityGroupsList = (com.amazonaws.internal.SdkInternalList<String>) modifyDBInstanceRequest .getDBSecurityGroups(); int dBSecurityGroupsListIndex = 1; if (!modifyDBInstanceRequest.getVpcSecurityGroupIds().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) modifyDBInstanceRequest.getVpcSecurityGroupIds()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> vpcSecurityGroupIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyDBInstanceRequest .getVpcSecurityGroupIds(); int vpcSecurityGroupIdsListIndex = 1; if (modifyDBInstanceRequest.getApplyImmediately() != null) { request.addParameter("ApplyImmediately", StringUtils.fromBoolean(modifyDBInstanceRequest.getApplyImmediately())); if (modifyDBInstanceRequest.getMasterUserPassword() != null) { request.addParameter("MasterUserPassword", StringUtils.fromString(modifyDBInstanceRequest.getMasterUserPassword()));
/** * Constructs a new ModifyDBInstanceRequest object. Callers should use the setter or fluent setter (with...) methods * to initialize any additional object members. * * @param dBInstanceIdentifier * The DB instance identifier. This value is stored as a lowercase string.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must match the identifier of an existing DBInstance. * </p> * </li> */ public ModifyDBInstanceRequest(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); }
setDBSecurityGroups(dBSecurityGroups); return this;
hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getAllocatedStorage() == null) ? 0 : getAllocatedStorage().hashCode()); hashCode = prime * hashCode + ((getDBInstanceClass() == null) ? 0 : getDBInstanceClass().hashCode()); hashCode = prime * hashCode + ((getDBSubnetGroupName() == null) ? 0 : getDBSubnetGroupName().hashCode()); hashCode = prime * hashCode + ((getDBSecurityGroups() == null) ? 0 : getDBSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getVpcSecurityGroupIds() == null) ? 0 : getVpcSecurityGroupIds().hashCode()); hashCode = prime * hashCode + ((getApplyImmediately() == null) ? 0 : getApplyImmediately().hashCode()); hashCode = prime * hashCode + ((getMasterUserPassword() == null) ? 0 : getMasterUserPassword().hashCode()); hashCode = prime * hashCode + ((getDBParameterGroupName() == null) ? 0 : getDBParameterGroupName().hashCode()); hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode()); hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode()); hashCode = prime * hashCode + ((getPreferredMaintenanceWindow() == null) ? 0 : getPreferredMaintenanceWindow().hashCode()); hashCode = prime * hashCode + ((getMultiAZ() == null) ? 0 : getMultiAZ().hashCode()); hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode()); hashCode = prime * hashCode + ((getAllowMajorVersionUpgrade() == null) ? 0 : getAllowMajorVersionUpgrade().hashCode()); hashCode = prime * hashCode + ((getAutoMinorVersionUpgrade() == null) ? 0 : getAutoMinorVersionUpgrade().hashCode()); hashCode = prime * hashCode + ((getLicenseModel() == null) ? 0 : getLicenseModel().hashCode()); hashCode = prime * hashCode + ((getIops() == null) ? 0 : getIops().hashCode()); hashCode = prime * hashCode + ((getOptionGroupName() == null) ? 0 : getOptionGroupName().hashCode()); hashCode = prime * hashCode + ((getNewDBInstanceIdentifier() == null) ? 0 : getNewDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getStorageType() == null) ? 0 : getStorageType().hashCode()); hashCode = prime * hashCode + ((getTdeCredentialArn() == null) ? 0 : getTdeCredentialArn().hashCode()); hashCode = prime * hashCode + ((getTdeCredentialPassword() == null) ? 0 : getTdeCredentialPassword().hashCode()); hashCode = prime * hashCode + ((getCACertificateIdentifier() == null) ? 0 : getCACertificateIdentifier().hashCode()); hashCode = prime * hashCode + ((getDomain() == null) ? 0 : getDomain().hashCode()); hashCode = prime * hashCode + ((getCopyTagsToSnapshot() == null) ? 0 : getCopyTagsToSnapshot().hashCode()); hashCode = prime * hashCode + ((getMonitoringInterval() == null) ? 0 : getMonitoringInterval().hashCode()); hashCode = prime * hashCode + ((getDBPortNumber() == null) ? 0 : getDBPortNumber().hashCode()); hashCode = prime * hashCode + ((getPubliclyAccessible() == null) ? 0 : getPubliclyAccessible().hashCode());