def get_connection(service, module=None, region=None, key=None, keyid=None,
                   profile=None):

    module = module or service

    svc_mod = __import__('boto.' + module, fromlist=[module])

    cxkey, region, key, keyid = _get_profile(service, region, key,
                                             keyid, profile)
    cxkey = cxkey + ':conn'

    if cxkey in __context__:
        return __context__[cxkey]

    try:
        conn = svc_mod.connect_to_region(region, aws_access_key_id=keyid,
                                         aws_secret_access_key=key)
        if conn is None:
            raise SaltInvocationError('Region "{0}" is not '
                                      'valid.'.format(region))
    except boto.exception.NoAuthHandlerFound:
        raise SaltInvocationError('No authentication credentials found when '
                                  'attempting to make boto {0} connection to '
                                  'region "{1}".'.format(service, region))
    __context__[cxkey] = conn
    return conn
Add the headers object to the message.
dataset/ETHPy150Open saltstack/salt/salt/utils/boto.py/get_connection--crossover with--dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/message.py/AddHeadersMigrator.MigrateForward