VMC on AWS: How to Export Firewall Rules from your SDDC

This KB article lists out steps to export firewall rules from your VMC on AWS SDDC. 

Solution

Pre-Requisites:

  • ORG ID = This can be found from the support tab of the VMC on AWS SDDC
  • SDDC ID = This can be found from the support tab of the VMC on AWS SDDC
  • O Auth Token or API token = Login into Cloud Portal (https://console.cloud.vmware.com) . Navigate to My Account > API Tokens > Generate Token > Give a name, select All Roles > Generate. (Make sure you note down the API Token somewhere safe)
  • Be sure to have python installed on your desktop. Python version 3.0 or latest is needed.
  • Packages that needs to be installed/present on desktop – requests, json, argparse (Command to install these packages. e.g. pip install requests)

Command Syntax:

python ExportVMCFWRules.py orgid sddcid refreshtoken > outFile.json 

Output:

outFile.json = This file will have all your SDDC Firewall rules which includes Management Gateway Rules, Compute Gateway Rules and NSX Distributed Firewall rules.


Script:
The script has been attached below.

Add a Comment