24ff9fd2fc7b0507d1c9dd3ac5dba887d8b34edd
Initial commit Changes to be committed: new file: README.md new file: abx/apply_nsx_tags_for_tiers/README.md new file: abx/apply_nsx_tags_for_tiers/action.py new file: abx/list_vcenter_vms/README.md new file: abx/list_vcenter_vms/action.py new file: abx/send_email/README.md new file: abx/send_email/action.py new file: blueprints/forms/vdefend-form.json new file: blueprints/vdefend-form-driven.yaml
vDefend Form-Driven Blueprint (VCF Automation 9)
This package contains:
blueprints/vdefend-form-driven.yaml— Cloud Template that calls Terraform to create vDefend groups/services/rules.blueprints/forms/vdefend-form.json— Custom Form draft that pulls vCenter VMs via ABX and parses CSV ports.- ABX actions:
list_vcenter_vms— exposes vCenter inventory for the form.apply_nsx_tags_for_tiers— tags selected VMs withtierandenv.send_email— generic SMTP mailer.
Wiring overview
-
Create ABX actions (Python 3):
list_vcenter_vms: set constantsVCENTER_SERVER,VCENTER_USERNAME,VCENTER_PASSWORD.apply_nsx_tags_for_tiers: none (reads blueprint inputs).send_email: set constantsSMTP_HOST(and optionally user/pass).
-
Import the Terraform module (re-use the
vdefend_baseline_modulefrom the previous kit, or point the blueprint to your Git path). -
Create the Cloud Template from
vdefend-form-driven.yaml. Mapnsx_*inputs to Project Secrets. -
Attach Custom Form:
- Import
vdefend-form.jsoninto the Form Designer for this template. - Change the data source
actionIdonvm_web,vm_app,vm_dbto the actual ABX ID oflist_vcenter_vms.
- Import
-
Event Subscriptions:
- Create a subscription: Event = Deployment Completed, Filter by blueprint name = vdefend-form-driven.
- Add two actions in order:
apply_nsx_tags_for_tiers— Map inputs from the deployment inputs (vm_web,vm_app,vm_db,env_value,nsx_manager_url,nsx_username,nsx_password).send_email— Buildbodyandto_emailusing deployment inputs/outputs:to_email = requester_emailsubject = "vDefend policy created: " + app_namebodyexample:Application: ${app_name} Environment: ${env_value} NSX Section: ${outputs.sectionPath} Groups: Web: ${outputs.groups.web} App: ${outputs.groups.app} DB : ${outputs.groups.db} Ports: Web->App: ${inputs.ports_web_to_app} App->DB : ${inputs.ports_app_to_db}
Notes
- The policy is tag-driven. After deployment, the ABX action tags your selected VMs:
{tier:web|app|db}and{env:<value>}. The groups in NSX will immediately include them. - To extend rules, add more arrays (e.g.,
ports_web_to_db) and mirror them in the Terraform module. - For strict change control, protect the section with a lock or maintain via GitOps-only.
Description
Languages
Python
100%