{"id":18834565,"url":"https://github.com/controlplane-com/terraform-provider-cpln","last_synced_at":"2026-03-07T01:08:26.523Z","repository":{"id":49751523,"uuid":"491971862","full_name":"controlplane-com/terraform-provider-cpln","owner":"controlplane-com","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-04T19:34:36.000Z","size":1970,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-05T01:42:07.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/controlplane-com.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-13T16:40:05.000Z","updated_at":"2026-03-04T19:34:38.000Z","dependencies_parsed_at":"2023-11-06T07:25:47.267Z","dependency_job_id":"ffb820e8-2c4e-4340-88dd-209638e95e4c","html_url":"https://github.com/controlplane-com/terraform-provider-cpln","commit_stats":null,"previous_names":[],"tags_count":88,"template":false,"template_full_name":null,"purl":"pkg:github/controlplane-com/terraform-provider-cpln","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Fterraform-provider-cpln","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Fterraform-provider-cpln/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Fterraform-provider-cpln/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Fterraform-provider-cpln/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/controlplane-com","download_url":"https://codeload.github.com/controlplane-com/terraform-provider-cpln/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/controlplane-com%2Fterraform-provider-cpln/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30204497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T02:13:13.589Z","updated_at":"2026-03-07T01:08:26.514Z","avatar_url":"https://github.com/controlplane-com.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Provider for Control Plane\r\n\r\n## Overview\r\n\r\nThis is the official [Control Plane](https://controlplane.com) Terraform provider. Terraform usage and reference documentation is available on the [Terraform Registry](https://registry.terraform.io/providers/controlplane-com/cpln/latest/docs).\r\n\r\n## Prerequisites:\r\n\r\n1. [Control Plane CLI](https://docs.controlplane.com/reference/cli#command-line-interface)\r\n2. [Terraform CLI](https://www.terraform.io/downloads.html)\r\n3. [Go](https://golang.org/doc/install)\r\n\r\n## Installation\r\n\r\n### From Source\r\n\r\nInstall `terraform-provider` locally.\r\n\r\n- From a path under '${GOPATH}', clone the provider code:\r\n\r\n```\r\ngit clone https://github.com/controlplane-com/terraform-provider-cpln.git\r\n```\r\n\r\n- cd into the cloned direction and install using make (Default OS Architecture is linux_amd64):\r\n\r\n```\r\ncd terraform-provider\r\nmake install\r\n\r\nFor macOS (Apple Silicion):\r\nmake install OS_ARCH=darwin_arm64\r\n\r\nFor macOS:\r\nmake install OS_ARCH=darwin_amd64\r\n```\r\n\r\nThe provider is installed under the `~/.terraform.d/plugins/` directory.\r\n\r\n### Alternative Local Execution of the Provider\r\n\r\nConsidering the provider is installed at path below after running the `make install` command:\r\n\r\n```\r\n/Users/\u003cusername\u003e/.terraform.d/plugins/controlplane.com/com/cpln/1.0.10/darwin_arm64\r\n```\r\n\r\n1. Add a `.terraform.rc` file on root with the contents below\r\n\r\n   ```hcl\r\n   provider_installation {\r\n     filesystem_mirror {\r\n       path    = \"/Users/\u003cusername\u003e/.terraform.d/plugins\"\r\n     }\r\n     direct {\r\n       exclude = [\"controlplane.com/*/*\"]\r\n     }\r\n   }\r\n   ```\r\n\r\n2. In your Terraform config (`main.tf`), set:\r\n\r\n   ```hcl\r\n   terraform {\r\n     required_providers {\r\n       cpln = {\r\n         source  = \"controlplane.com/com/cpln\"\r\n         version = \"\u003cversion\u003e\"\r\n       }\r\n     }\r\n   }\r\n   ```\r\n\r\n3. Run `terraform init`. You should see the warning below if it succeeded:\r\n\r\n    ```\r\n    Warning: Incomplete lock file information for providers\r\n\r\n    Due to your customized provider installation methods, Terraform was forced to\r\n    calculate lock file checksums locally for the following providers:\r\n    - controlplane.com/com/cpln\r\n    ```\r\n\r\n### Debugging\r\n\r\nWhen debugging, create the file at `.vscode/launch.json` by copying and editing it from the `launch.json.example` file.\r\n\r\n## Examples\r\n\r\nSee the [HCL](https://www.terraform.io/docs/configuration/syntax.html) examples within the `/examples` directory.\r\n\r\n## Quickstart\r\n\r\n```bash\r\n# 1. Log in via CLI\r\ncpln login\r\n\r\n# (For test environment)\r\ncpln profile update default --login --endpoint https://api.test.cpln.io\r\n\r\n# 2. Initialize Terraform\r\nterraform init\r\n\r\n# 3. Apply a sample configuration\r\nterraform apply -var=\"org=\u003cYOUR_ORG\u003e\"\r\n\r\n# 4. When you’re done:\r\nterraform destroy -var=\"org=\u003cYOUR_ORG\u003e\"\r\n```\r\n\r\nFor full examples, see the [examples/](./examples) directory.\r\n\r\n## Testing\r\n\r\n- **Unit Tests**:\r\n  ```bash\r\n  make test\r\n  ```\r\n- **Acceptance Tests**:\r\n  ```bash\r\n  make testacc\r\n  ```\r\n\r\nMake sure to configure a valid `org` in `internal/provider/config.go` before running acceptance tests.\r\n\r\n## Control Plane CLI Helper Notes:\r\n\r\n1. Creating a new service account\r\n\r\n```\r\n    a) Create service account:\r\n        'cpln serviceaccount create --name \u003cservice_account_name\u003e --org \u003corganization_name\u003e'\r\n\r\n    b) Edit group:\r\n        'cpln group edit superusers --org \u003corganization_name\u003e'\r\n\r\n        Using the editor, add the service account to the memberLinks element using the format:\r\n        '/org/\u003corganziation_name\u003e/serviceaccount/\u003cservice_account_name\u003e'\r\n\r\n    c) Add key to service account:\r\n        'cpln serviceaccount add-key \u003cservice_account_name\u003e --org \u003corganization_name\u003e --description \u003ckey_description\u003e'\r\n\r\n    d) Create a profile with the token output from step c:\r\n        'cpln profile create \u003cprofile_name\u003e --token \u003ctoken\u003e'\r\n```\r\n\r\n2. To obtain a valid access token via the Control Plane CLI:\r\n\r\n```\r\n    a) Using the default profile:\r\n        'cpln profile token'\r\n        OR\r\n        'cpln profile token default'\r\n\r\n    b) Using a created profile:\r\n        'cpln profile token \u003cprofile_name\u003e'\r\n```\r\n\r\n3. Misc WSL Commands\r\n\r\n```\r\n    a) Allow WSL network through Windows Firewall:\r\n        New-NetFirewallRule -DisplayName \"WSL\" -Direction Inbound  -InterfaceAlias \"vEthernet (WSL)\"  -Action Allow\r\n\r\n```\r\n\r\n## Terraform Documentation Helper Links\r\n\r\n1. [Provider Documentation](https://www.terraform.io/docs/registry/providers/docs.html)\r\n2. [Document Preview](https://registry.terraform.io/tools/doc-preview)\r\n\r\n## Generate Reference Documentation\r\n\r\n1. Run the script `cpln_docs.sh` within the /scripts directory.\r\n2. Copy the `terraform_reference.mdx` file to the directory `/pages/terraform` in the documentation project.\r\n\r\n## Compress Commands\r\n\r\n1. Run `make release`\r\n2. Plugins will be in /bin directory\r\n3. Use commands below to compress (update version)\r\n\r\nmacOS\r\n\r\n```\r\ntar -cvzf terraform-provider-cpln_1.0.0_darwin_amd64.tgz terraform-provider-cpln_1.0.0_darwin_amd64\r\n```\r\n\r\nmacOS (Apple Silicon)\r\n\r\n```\r\ntar -cvzf terraform-provider-cpln_1.0.0_darwin_amd64.tgz terraform-provider-cpln_1.0.0_darwin_arm64\r\n```\r\n\r\nLinux\r\n\r\n```\r\ntar -cvzf terraform-provider-cpln_1.0.0_linux_amd64.tgz terraform-provider-cpln_1.0.0_linux_amd64\r\n```\r\n\r\nWindows\r\n\r\n```\r\ntar -cvzf terraform-provider-cpln_1.0.0_windows_amd64.zip terraform-provider-cpln_1.0.0_windows_amd64.exe\r\n```\r\n\r\n## Terraform Registry Publishing\r\n\r\n- https://www.terraform.io/registry/providers/publishing\r\n- git tag vX.X.X\r\n- git push origin vX.X.X\r\n\r\n## Notes\r\n\r\n- Needed to add CGO_ENABLED=0 for linux build when running within an alpine image. See: https://github.com/Mastercard/terraform-provider-restapi/issues/65\r\n- CLI Config File: https://www.terraform.io/docs/cli/config/config-file.html\r\n\r\n## Development\r\n\r\nWhen adding new resources or data sources:\r\n\r\n1. Update the API client schema in `internal/provider/client/\u003citem\u003e.go`.\r\n2. Define or adjust the Terraform schema in:\r\n   - `internal/provider/resource_\u003citem\u003e.go` (resources)\r\n   - `internal/provider/data_source_\u003citem\u003e.go` (data sources)\r\n3. Update the CRUD/context functions under each resource.\r\n4. Add or update tests in `*_test.go`.\r\n5. Regenerate the reference docs via:\r\n   ```bash\r\n   cd scripts\r\n   ./cpln_docs.sh\r\n   # then copy terraform_reference.mdx into your docs site\r\n   ```\r\n6. Update resource / data source examples.\r\n\r\n## CHANGELOG\r\n\r\nAll version history and release notes have been moved to [CHANGELOG.md](./CHANGELOG.md).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrolplane-com%2Fterraform-provider-cpln","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontrolplane-com%2Fterraform-provider-cpln","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontrolplane-com%2Fterraform-provider-cpln/lists"}