How vmware/terraform-provider-nsxt works
• Terraform CLI & Provider Interface – This is how Terraform (when you run terraform init/apply) communicates with the provider.
• Provider Plugin Core – The heart of the provider (main.go and the provider configuration code) that accepts commands from Terraform.
• API Client & Resource Modules – The internal Go packages such as the “api” directory, “nsxt” directory, and various domain/resource-specific files (e.g., security policies, tiers, DHCP configurations, etc.). These modules encapsulate the logic to call VMware NSX APIs.
• NSX Management/External API – Representing the external VMware NSX product that the provider communicates with.
• CI/CD & Testing Pipeline – Elements like .github workflows, Travis, and various build and test scripts indicate that there is a robust automation layer which validates the provider. Although not part of runtime architecture, include it to understand the development lifecycle.
• Optionally, add a branch or auxiliary section for CI/CD tools and automated testing (GitHub Actions, Travis, etc.) to indicate that changes in the provider code trigger automated validations.
Architectural Patterns/Design Principles
• Plugin Architecture: Emphasize the separation between Terraform core and the provider.
• Modularization: The project’s file tree shows granular packages grouped by functionality (e.g., “api/infra”, “nsxt”, “tools”, “docs”). This indicates clear modular boundaries between resource definitions, utilities, and documentation.
• Dependency Management: Notice files like “go.mod,” “go.sum,” and continuous integration scripts; include a note on how the provider leverages Go modules and CI workflows (build, linting, tests) for modular, high-quality development.