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

Commit 2a878a0

Browse files
authored
Merge pull request #111 from remind101/minor_fixes_for_aurora_bps
Fix some minor issues found while testing at Remind
2 parents 1ff02e3 + 4096faf commit 2a878a0

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

stacker_blueprints/rds/base.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ class BaseRDS(Blueprint):
9191
"during maintenance windows.",
9292
"default": False,
9393
},
94+
"DBFamily": {
95+
"type": str,
96+
"description": "DBFamily for ParameterGroup.",
97+
},
9498
"StorageType": {
9599
"type": str,
96100
"description": "Storage type for RDS instance. Defaults to "
@@ -188,10 +192,6 @@ def should_create_internal_hostname(self):
188192
]
189193
)
190194

191-
def get_piops(self):
192-
variables = self.get_variables()
193-
return variables["IOPS"] or Ref("AWS::NoValue")
194-
195195
def get_storage_type(self):
196196
variables = self.get_variables()
197197
return variables["StorageType"] or Ref("AWS::NoValue")
@@ -269,12 +269,16 @@ def create_option_group(self):
269269

270270
def create_rds(self):
271271
t = self.template
272-
t.add_resource(
273-
DBInstance(
274-
DBINSTANCE,
275-
StorageType=self.get_storage_type(),
276-
Iops=self.get_piops(),
277-
**self.get_common_attrs()))
272+
variables = self.get_variables()
273+
db = DBInstance(
274+
DBINSTANCE,
275+
StorageType=self.get_storage_type(),
276+
**self.get_common_attrs())
277+
# Hack till https://github.com/cloudtools/troposphere/pull/652/
278+
# is accepted
279+
if variables["IOPS"]:
280+
db.Iops = variables["IOPS"]
281+
t.add_resource(db)
278282

279283
def create_dns_records(self):
280284
t = self.template
@@ -382,10 +386,6 @@ def defined_variables(self):
382386
"type": str,
383387
"description": "Database engine version for the RDS Instance.",
384388
},
385-
"DBFamily": {
386-
"type": str,
387-
"description": "DBFamily for ParameterGroup.",
388-
},
389389
"StorageEncrypted": {
390390
"type": bool,
391391
"description": "Set to 'false' to disable encrypted storage.",
@@ -447,10 +447,6 @@ def defined_variables(self):
447447
"type": str,
448448
"description": "Database engine version for the RDS Instance.",
449449
},
450-
"DBFamily": {
451-
"type": str,
452-
"description": "DBFamily for ParameterGroup.",
453-
},
454450
"StorageEncrypted": {
455451
"type": bool,
456452
"description": "Set to 'false' to disable encrypted storage.",
@@ -505,6 +501,7 @@ def get_common_attrs(self):
505501
"DBInstanceClass": variables["InstanceType"],
506502
"DBInstanceIdentifier": variables["DBInstanceIdentifier"],
507503
"DBSnapshotIdentifier": self.get_db_snapshot_identifier(),
504+
"DBParameterGroupName": Ref("ParameterGroup"),
508505
"Engine": self.engine() or variables["Engine"],
509506
"LicenseModel": Ref("AWS::NoValue"),
510507
"Tags": self.get_tags(),

0 commit comments

Comments
 (0)