rename duplicate rds/models db_instance_identifier to physical_resource_id (#776)

* rename duplicate db_instance_identifier to physical_resource_id

* Update create_from_cloudformation_json to use db_source_identifier str

* Update code to be more conventional.
This commit is contained in:
David Wilcox 2016-11-24 13:07:26 +11:00 committed by Steve Pulec
parent d6890640b2
commit c3c6eaf281

View File

@ -37,7 +37,6 @@ class Database(object):
self.source_db_identifier = kwargs.get("source_db_identifier")
self.db_instance_class = kwargs.get('db_instance_class')
self.port = kwargs.get('port')
self.db_instance_identifier = kwargs.get('db_instance_identifier')
self.db_name = kwargs.get("db_name")
self.publicly_accessible = kwargs.get("publicly_accessible")
if self.publicly_accessible is None:
@ -65,6 +64,10 @@ class Database(object):
# DBParameterGroupName
# VpcSecurityGroupIds.member.N
@property
def physical_resource_id(self):
return self.db_instance_identifier
@property
def address(self):
return "{0}.aaaaaaaaaa.{1}.rds.amazonaws.com".format(self.db_instance_identifier, self.region)
@ -130,7 +133,7 @@ class Database(object):
source_db_identifier = properties.get("SourceDBInstanceIdentifier")
if source_db_identifier:
# Replica
db_kwargs["source_db_identifier"] = source_db_identifier.db_instance_identifier
db_kwargs["source_db_identifier"] = source_db_identifier
database = rds_backend.create_database_replica(db_kwargs)
else:
database = rds_backend.create_database(db_kwargs)