def main()

in python/gwlb/create_gwlb_sample.py [0:0]


def main():
    """
    Creates Gateway Load Balancer (GWLB)

    Accepts:
    --gwlb_name: GWLB name
    --subnet_ids: Subnet ids to be assocated with GWLB

    Usage:
    python create_gwlb_sample.py --gwlb_name boto3-gwlb1 \
    --subnet_ids 'subnet-0348ec3f4869e2a1f' 'subnet-04132654a0e466491'
    """
    parser = argparse.ArgumentParser()
    parser.add_argument('--gwlb_name', required=True,
                        help='specify gateway load balancer name', type=str)
    parser.add_argument('--subnet_ids', nargs='+', required=True,
                        help='specify subnet ids')

    args = parser.parse_args()
    ############################
    # Define script variables:
    ############################
    gwlb_name = args.gwlb_name
    subnet_ids = args.subnet_ids
    #############################
    # GWLB:
    gwlb1 = create_gwlb(gwlb_name, subnet_ids)
    gwlb1_arn = gwlb1[0]['LoadBalancers'][0]['LoadBalancerArn']
    print(f"GWLB ARN: {gwlb1_arn}")