How cisco-en-programmability/terraform-provider-catalystcenter works
Project type and purpose
• This is a Terraform provider plugin written in Go, named terraform-provider-catalystcenter.
• Purpose: allow Terraform users to manage Cisco Catalyst Center resources (networks, devices, policies, etc.) via Terraform HCL by wrapping Cisco Catalyst Center’s REST API.
File structure
• Top-level Go modules:
• main.go – CLI entrypoint for the provider binary
• catalystcenter/ – package containing all provider code
– provider.go – registers provider with Terraform SDK
– config.go, utils.go, validators.go – configuration and helpers
– data_source_*.go – definitions for every data-source
– resource_*.go – definitions for every resource
– convert.go – mapping between Terraform types and API types
– logger.go – logging helper
• docs/, examples/, examples/samples/ – user documentation and sample Terraform configurations
• Makefile, scripts/ – build, test, formatting and lint scripts
• go.mod / go.sum – Go dependency management
• No database components; interactions are purely via HTTP to Cisco Catalyst Center.
Insights from the README
• Provider requires Terraform 0.13+ and Go 1.20 to build.
• It exposes dozens of resources and data-sources corresponding to Catalyst Center API endpoints.
• It relies on environment variables or HCL config for credentials (username, password, base_url, debug, ssl_verify).
• Build and test via make build, make test, make testacc.
Be detailed
• Which Go packages handle which responsibilities
• HTTP vs. RPC boundaries
• Do not forget build/test scripts and documentation as supportive artifacts