#NEWLINE# def replica_present( name , source , db_instance_class = None , availability_zone = None , port = None , auto_minor_version_upgrade = None , iops = None , option_group_name = None , publicly_accessible = None , tags = None , region = None , key = None , keyid = None , profile = None ) : #NEWLINE# #INDENT# '\n    Ensure RDS replica exists.\n\n    .. code-block:: yaml\n\n        Ensure myrds replica RDS exists:\n          boto_rds.create_replica:\n            - name: myreplica\n            - source: mydb\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : None , #NEWLINE# 'comment' : '' , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# replica_exists = __salt__ [ 'boto_rds.exists' ] ( name , tags , region , key , keyid , profile ) #NEWLINE# if ( not replica_exists ) : #NEWLINE# #INDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'RDS read replica {0} is set to be created ' . format ( name ) #NEWLINE# ret [ 'result' ] = None #NEWLINE# return ret #NEWLINE# #UNINDENT# created = __salt__ [ 'boto_rds.create_read_replica' ] ( name , source , db_instance_class , availability_zone , port , auto_minor_version_upgrade , iops , option_group_name , publicly_accessible , tags , region , key , keyid , profile ) #NEWLINE# if created : #NEWLINE# #INDENT# config = __salt__ [ 'boto_rds.describe' ] ( name , tags , region , key , keyid , profile ) #NEWLINE# ret [ 'result' ] = True #NEWLINE# ret [ 'comment' ] = 'RDS replica {0} created.' . format ( name ) #NEWLINE# ret [ 'changes' ] [ 'old' ] = None #NEWLINE# ret [ 'changes' ] [ 'new' ] = config #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Failed to create RDS replica {0}.' . format ( name ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'result' ] = True #NEWLINE# ret [ 'comment' ] = 'RDS replica {0} exists.' . format ( name ) #NEWLINE# #UNINDENT# return ret