Added read replica support
This commit is contained in:
parent
42ab9312bb
commit
0d958e9b1c
4 changed files with 36 additions and 46 deletions
|
|
@ -88,14 +88,12 @@ class Database(object):
|
|||
def address(self):
|
||||
return "{0}.aaaaaaaaaa.{1}.rds.amazonaws.com".format(self.db_instance_identifier, self.region)
|
||||
|
||||
# TODO: confirm how this should represent in the RESULT JSON
|
||||
def add_replica(self, replica):
|
||||
self.replicas.append(replica.db_instance_identifier)
|
||||
|
||||
def remove_replica(self, replica):
|
||||
self.replicas.remove(replica.db_instance_identifier)
|
||||
|
||||
# TODO: confirm how this should represent in the RESULT JSON
|
||||
def set_as_replica(self):
|
||||
self.is_replica = True
|
||||
self.replicas = []
|
||||
|
|
@ -210,7 +208,11 @@ class Database(object):
|
|||
"{{ replica }}"
|
||||
{%- endfor -%}
|
||||
],
|
||||
{%- if database.source_db_identifier -%}
|
||||
"ReadReplicaSourceDBInstanceIdentifier": "{{ database.source_db_identifier }}",
|
||||
{%- else -%}
|
||||
"ReadReplicaSourceDBInstanceIdentifier": null,
|
||||
{%- endif -%}
|
||||
"SecondaryAvailabilityZone": null,
|
||||
"StatusInfos": null,
|
||||
"VpcSecurityGroups": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue