def present(
        name,
        engine=None,
        cache_node_type=None,
        num_cache_nodes=None,
        preferred_availability_zone=None,
        port=None,
        cache_parameter_group_name=None,
        cache_security_group_names=None,
        replication_group_id=None,
        auto_minor_version_upgrade=True,
        security_group_ids=None,
        cache_subnet_group_name=None,
        engine_version=None,
        notification_topic_arn=None,
        preferred_maintenance_window=None,
        wait=None,
        region=None,
        key=None,
        keyid=None,
        profile=None):
    ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
    if cache_security_group_names and cache_subnet_group_name:
        _subnet_group = __salt__['boto_elasticache.get_cache_subnet_group'](
            cache_subnet_group_name, region, key, keyid, profile
        )
        vpc_id = _subnet_group['vpc_id']
        if not security_group_ids:
            security_group_ids = []
        _security_group_ids = __salt__['boto_secgroup.convert_to_group_ids'](
            cache_security_group_names, vpc_id, region, key, keyid, profile
        )
        security_group_ids.extend(_security_group_ids)
        cache_security_group_names = None
    config = __salt__['boto_elasticache.get_config'](name, region, key, keyid,
                                                     profile)
    if config is None:
        msg = 'Failed to retrieve cache cluster info from AWS.'
        ret['comment'] = msg
        ret['result'] = None
        return ret
    elif not config:
        if __opts__['test']:
            msg = 'Cache cluster {0} is set to be created.'.format(name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
        created = __salt__['boto_elasticache.create'](
            name=name, num_cache_nodes=num_cache_nodes,
            cache_node_type=cache_node_type, engine=engine,
            replication_group_id=replication_group_id,
            engine_version=engine_version,
            cache_parameter_group_name=cache_parameter_group_name,
            cache_subnet_group_name=cache_subnet_group_name,
            cache_security_group_names=cache_security_group_names,
            security_group_ids=security_group_ids,
            preferred_availability_zone=preferred_availability_zone,
            preferred_maintenance_window=preferred_maintenance_window,
            port=port, notification_topic_arn=notification_topic_arn,
            auto_minor_version_upgrade=auto_minor_version_upgrade,
            wait=wait, region=region, key=key, keyid=keyid, profile=profile)
        if created:
            ret['changes']['old'] = None
            config = __salt__['boto_elasticache.get_config'](name, region, key,
                                                             keyid, profile)
            ret['changes']['new'] = config
        else:
            ret['result'] = False
            ret['comment'] = 'Failed to create {0} cache cluster.'.format(name)
            return ret
    # TODO: support modification of existing elasticache clusters
    else:
        ret['comment'] = 'Cache cluster {0} is present.'.format(name)
    return ret
Ensure the cache cluster exists.
dataset/ETHPy150Open saltstack/salt/salt/states/boto_elasticache.py/present