PROJECT: Aviatrix Transit Network API with Python:
This Python project demonstrates using Aviatrix REST API to build Transit Network solution.
- Need to have at least 3 VPCs (1 for Transit VPC and 2 for Spoke VPCs) and 1 VGW available.
Python 3 packages/libraries
$ pip install requests
- MUST complete the script configuration file "config/config.json". The example can be found in the file "config/example-config.json".
- To Build Transit Network
$ python build_transit_network.py
- To Tear down Transit Network
$ python teardown_transit_network.py
To finish building the topology, it takes roughly 15-30 min (with 2 Spoke Gateways) depending on the regions of your resources.
What might be new on next version of the script: - Connect On-Prem VPC - Connect Share-Service-VPC - Connect Exgress VPC
Q: How to modify "config.json" to create more Spoke gateways in different VPCs?
- Ans: In "config.json" file, the "value" of the "key", "spoke_gateways" is a list/array of json objects. Each object/element represents a Spoke VPC/Gateway. Since we already have 2 elements in the list, we just need to append a new element at the end of the array.
Q: What does "ha_enabled" in "config.json" do?
- Ans: By default, the value is "yes". If the value of "ha_enabled" is "yes", that means the script will have HA for connections between Transit/Spoke Gateways and VGW.
Q: What does "pause_on_every_step" in "config.json" do?
- Ans: By default, the value is "no". Which means the script won't be paused/interrupted (assume there is no error occurs) until the script finishes. If the value is "yes", and user needs to enter any key to proceed the script right after each Aviatrix REST API is completed. You're using this feature ONLY because you wish check the result of each API execution.
Ryan Liu - Aviatrix Systems Inc