def release_ipv6()

in code/assign-ip-new-ip6-parallel.py [0:0]


def release_ipv6(ip6List,subnet_cidr,client):
    tprint("Going to release ip6List: " + str(ip6List))     
    
    response = client.describe_network_interfaces(
        Filters=[
            {
                'Name': 'ipv6-addresses.ipv6-address',
                'Values': ip6List
            },
        ],
    )
    if response['NetworkInterfaces'] == []:
        tprint("ENI of ipv6 not attached yet, no need to release")
    else:
        for j in response['NetworkInterfaces']:
            network_interface_id = j['NetworkInterfaceId']
            response = client.unassign_ipv6_addresses(
                Ipv6Addresses=ip6List,
                NetworkInterfaceId = network_interface_id
            )
    tprint("Finished releasing ip6List: " + str(ip6List))