def save
if source_snapshot_id
requires :id
data = service.restore_db_instance_from_db_snapshot(source_snapshot_id, id, attributes_to_params)
merge_attributes(data.body['RestoreDBInstanceFromDBSnapshotResult']['DBInstance'])
else
requires :engine
if engine == 'aurora'
requires :cluster_id
self.flavor_id ||= 'db.r3.large'
else
requires :master_username
requires :password
requires :allocated_storage
self.flavor_id ||= 'db.m1.small'
end
data = service.create_db_instance(id, attributes_to_params)
merge_attributes(data.body['CreateDBInstanceResult']['DBInstance'])
true
end
end