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

Fix some minor issues found while testing at Remind #111

Merged
merged 1 commit into from
May 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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