-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQL Server support for RDS broker (#58)
* SQL Server support for RDS broker - Added SqlServerClient - Pushed defaults into the RDS clients * SQL Server support for RDS broker - removing unused variable
- Loading branch information
Showing
7 changed files
with
144 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/com/libertymutualgroup/herman/aws/ecs/broker/rds/SqlServerClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.libertymutualgroup.herman.aws.ecs.broker.rds; | ||
|
||
import com.amazonaws.services.rds.AmazonRDS; | ||
import com.libertymutualgroup.herman.aws.ecs.cluster.EcsClusterMetadata; | ||
import com.libertymutualgroup.herman.aws.tags.HermanTag; | ||
import com.libertymutualgroup.herman.logging.HermanLogger; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class SqlServerClient extends StandardRdsClient { | ||
|
||
private AmazonRDS client; | ||
private RdsInstance rds; | ||
private EcsClusterMetadata clusterMetadata; | ||
private List<HermanTag> tags; | ||
private HermanLogger logger; | ||
|
||
SqlServerClient(AmazonRDS client, RdsInstance rds, EcsClusterMetadata clusterMetadata, List<HermanTag> tags, | ||
HermanLogger logger) { | ||
super(client, rds, clusterMetadata, tags, logger); | ||
this.client = client; | ||
this.rds = rds; | ||
this.clusterMetadata = clusterMetadata; | ||
this.tags = tags; | ||
this.logger = logger; | ||
} | ||
|
||
@Override | ||
public void setDefaults(String kmsKeyId) { | ||
rds.setInjectNames(rds.getInjectNames() == null ? new RdsInjectConfiguration() : rds.getInjectNames()); | ||
|
||
rds.getInjectNames().setDefaults(); | ||
|
||
rds.setMasterUsername(rds.getMasterUsername() == null ? "dbAdmin" : rds.getMasterUsername()); | ||
rds.setDBInstanceClass(rds.getDBInstanceClass() == null ? "db.m4.large" : rds.getDBInstanceClass()); | ||
rds.setAllocatedStorage(rds.getAllocatedStorage() == null ? 200 : rds.getAllocatedStorage()); | ||
rds.setPubliclyAccessible(rds.getPubliclyAccessible() == null ? false : rds.getPubliclyAccessible()); | ||
rds.setAutoMinorVersionUpgrade(rds.getAutoMinorVersionUpgrade() == null ? true : rds.getAutoMinorVersionUpgrade()); | ||
rds.setPreferredBackupWindow(rds.getPreferredBackupWindow() == null ? "01:00-02:00" : rds.getPreferredBackupWindow()); | ||
rds.setPreferredMaintenanceWindow( | ||
rds.getPreferredMaintenanceWindow() == null ? "sun:20:00-sun:21:00" : rds.getPreferredMaintenanceWindow()); | ||
rds.setBackupRetentionPeriod(rds.getBackupRetentionPeriod() == null ? 14 : rds.getBackupRetentionPeriod()); | ||
rds.setStorageType(rds.getStorageType() == null ? "gp2" : rds.getStorageType()); | ||
rds.setFullUpdate(rds.getFullUpdate() == null ? false : rds.getFullUpdate()); | ||
rds.setIAMDatabaseAuthenticationEnabled( | ||
rds.getIAMDatabaseAuthenticationEnabled() == null ? false : rds.getIAMDatabaseAuthenticationEnabled()); | ||
rds.setAvailabilityZones(rds.getAvailabilityZones() == null ? new String[]{"us-east-1a"} : rds.getAvailabilityZones()); | ||
rds.setPreDeployBackup(rds.getPreDeployBackup() == null ? false : rds.getPreDeployBackup()); | ||
rds.setExtensions(rds.getExtensions() == null ? new ArrayList<>() : rds.getExtensions()); | ||
rds.setKmsKeyId(rds.getKmsKeyId() == null ? kmsKeyId : rds.getKmsKeyId()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters