def creategroup(name, primary_cluster_id, replication_group_description, wait=None, region=None, key=None, keyid=None, profile=None):
 ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
 is_present = __salt__['boto_elasticache.group_exists'](name, region, key, keyid, profile)
 if (not is_present):
  if __opts__['test']:
   ret['comment'] = 'Replication {0} is set to be created.'.format(name)
   ret['result'] = None
  created = __salt__['boto_elasticache.create_replication_group'](name, primary_cluster_id, replication_group_description, wait, region, key, keyid, profile)
  if created:
   config = __salt__['boto_elasticache.describe_replication_group'](name, region, key, keyid, profile)
   ret['changes']['old'] = None
   ret['changes']['new'] = config
   ret['result'] = True
  else:
   ret['result'] = False
   ret['comment'] = 'Failed to create {0} replication group.'.format(name)
 else:
  ret['comment'] = '{0} replication group exists .'.format(name)
  ret['result'] = True
 return ret

def creategroup ( name , primary_cluster_id , replication_group_description , wait = None , region = None , key = None , keyid = None , profile = None ) : ret = { 'name' : name , 'result' : None , 'comment' : '' , 'changes' : { } } is_present = __salt__ [ 'boto_elasticache.group_exists' ] ( name , region , key , keyid , profile ) if ( not is_present ) : if __opts__ [ 'test' ] : ret [ 'comment' ] = 'Replication {0} is set to be created.' . format ( name ) ret [ 'result' ] = None created = __salt__ [ 'boto_elasticache.create_replication_group' ] ( name , primary_cluster_id , replication_group_description , wait , region , key , keyid , profile ) if created : config = __salt__ [ 'boto_elasticache.describe_replication_group' ] ( name , region , key , keyid , profile ) ret [ 'changes' ] [ 'old' ] = None ret [ 'changes' ] [ 'new' ] = config ret [ 'result' ] = True else : ret [ 'result' ] = False ret [ 'comment' ] = 'Failed to create {0} replication group.' . format ( name ) else : ret [ 'comment' ] = '{0} replication group exists .' . format ( name ) ret [ 'result' ] = True return ret
ensure the a replication group is create .