def clone_lc(client, lc, name, image_id):
    """
    Create a new Launch Configuration identical to the one passed in, except
    for the new name and new image ID.

    """
    PARAMS_TO_CLONE = [
        'KeyName',
        'SecurityGroups',
        'ClassicLinkVPCId',
        'ClassicLinkVPCSecurityGroups',
        'UserData',
        'InstanceType',
        'BlockDeviceMappings',
        'InstanceMonitoring',
        'SpotPrice',
        'IamInstanceProfile',
        'EbsOptimized',
        'AssociatePublicIpAddress',
        'PlacementTenancy',
    ]
    try:
        params = {
            key: lc[key] for key in PARAMS_TO_CLONE if key in lc
        }
    except KeyError:
        print(list(lc.keys()))
        raise
    # We need special handling for kernel ID and ramdisk ID.
    if lc['KernelId']:
        params['KernelId'] = lc['KernelId']
    if lc['RamdiskId']:
        params['RamdiskId'] = lc['RamdiskId']
    client.create_launch_configuration(
        LaunchConfigurationName=name,
        ImageId=image_id,
        **params
    )
    return client.describe_launch_configurations(
        LaunchConfigurationNames=[name],
    )['LaunchConfigurations'][0]