Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #111 from remind101/minor_fixes_for_aurora_bps
Browse files Browse the repository at this point in the history
Fix some minor issues found while testing at Remind
  • Loading branch information
phobologic authored May 18, 2017
2 parents 1ff02e3 + 4096faf commit 2a878a0
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions stacker_blueprints/rds/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class BaseRDS(Blueprint):
"during maintenance windows.",
"default": False,
},
"DBFamily": {
"type": str,
"description": "DBFamily for ParameterGroup.",
},
"StorageType": {
"type": str,
"description": "Storage type for RDS instance. Defaults to "
Expand Down Expand Up @@ -188,10 +192,6 @@ def should_create_internal_hostname(self):
]
)

def get_piops(self):
variables = self.get_variables()
return variables["IOPS"] or Ref("AWS::NoValue")

def get_storage_type(self):
variables = self.get_variables()
return variables["StorageType"] or Ref("AWS::NoValue")
Expand Down Expand Up @@ -269,12 +269,16 @@ def create_option_group(self):

def create_rds(self):
t = self.template
t.add_resource(
DBInstance(
DBINSTANCE,
StorageType=self.get_storage_type(),
Iops=self.get_piops(),
**self.get_common_attrs()))
variables = self.get_variables()
db = DBInstance(
DBINSTANCE,
StorageType=self.get_storage_type(),
**self.get_common_attrs())
# Hack till https://github.com/cloudtools/troposphere/pull/652/
# is accepted
if variables["IOPS"]:
db.Iops = variables["IOPS"]
t.add_resource(db)

def create_dns_records(self):
t = self.template
Expand Down Expand Up @@ -382,10 +386,6 @@ def defined_variables(self):
"type": str,
"description": "Database engine version for the RDS Instance.",
},
"DBFamily": {
"type": str,
"description": "DBFamily for ParameterGroup.",
},
"StorageEncrypted": {
"type": bool,
"description": "Set to 'false' to disable encrypted storage.",
Expand Down Expand Up @@ -447,10 +447,6 @@ def defined_variables(self):
"type": str,
"description": "Database engine version for the RDS Instance.",
},
"DBFamily": {
"type": str,
"description": "DBFamily for ParameterGroup.",
},
"StorageEncrypted": {
"type": bool,
"description": "Set to 'false' to disable encrypted storage.",
Expand Down Expand Up @@ -505,6 +501,7 @@ def get_common_attrs(self):
"DBInstanceClass": variables["InstanceType"],
"DBInstanceIdentifier": variables["DBInstanceIdentifier"],
"DBSnapshotIdentifier": self.get_db_snapshot_identifier(),
"DBParameterGroupName": Ref("ParameterGroup"),
"Engine": self.engine() or variables["Engine"],
"LicenseModel": Ref("AWS::NoValue"),
"Tags": self.get_tags(),
Expand Down

0 comments on commit 2a878a0

Please sign in to comment.