

def _format_vpn_connection(vpn_connection, customer_gateways, os_ikepolicies, os_ipsecpolicies, os_ipsec_site_connections, external_ips):
    config_dict = _format_customer_config(vpn_connection, customer_gateways, os_ikepolicies, os_ipsecpolicies, os_ipsec_site_connections, external_ips)
    config = ec2utils.dict_to_xml(config_dict, 'vpn_connection')
    config.attrib['id'] = vpn_connection['id']
    config_str = etree.tostring(config, xml_declaration=True, encoding='UTF-8', pretty_print=True)
    return {
        'vpnConnectionId': vpn_connection['id'],
        'vpnGatewayId': vpn_connection['vpn_gateway_id'],
        'customerGatewayId': vpn_connection['customer_gateway_id'],
        'state': 'available',
        'type': 'ipsec.1',
        'routes': [{
            'destinationCidrBlock': cidr,
            'state': 'available',
        } for cidr in vpn_connection['cidrs']],
        'vgwTelemetry': [],
        'options': {
            'staticRoutesOnly': True,
        },
        'customerGatewayConfiguration': config_str,
    }

dataset/ETHPy150Open openstack/ec2-api/ec2api/api/vpn_connection.py _format_vpn_connection/original