{"id":37992762,"url":"https://github.com/octopusdeploy/terraform-provider-octopusdeploy","last_synced_at":"2026-04-02T22:17:37.342Z","repository":{"id":332300683,"uuid":"984415698","full_name":"OctopusDeploy/terraform-provider-octopusdeploy","owner":"OctopusDeploy","description":"Terraform Provider for Octopus Deploy 🐙","archived":false,"fork":false,"pushed_at":"2026-03-02T01:16:36.000Z","size":25514,"stargazers_count":5,"open_issues_count":27,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-02T02:11:21.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OctopusDeploy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2025-05-15T22:35:21.000Z","updated_at":"2026-03-02T01:16:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/OctopusDeploy/terraform-provider-octopusdeploy","commit_stats":null,"previous_names":["octopusdeploy/terraform-provider-octopusdeploy"],"tags_count":250,"template":false,"template_full_name":null,"purl":"pkg:github/OctopusDeploy/terraform-provider-octopusdeploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2Fterraform-provider-octopusdeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2Fterraform-provider-octopusdeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2Fterraform-provider-octopusdeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2Fterraform-provider-octopusdeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OctopusDeploy","download_url":"https://codeload.github.com/OctopusDeploy/terraform-provider-octopusdeploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OctopusDeploy%2Fterraform-provider-octopusdeploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30111779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"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":"2026-01-16T18:44:56.931Z","updated_at":"2026-03-05T06:01:11.405Z","avatar_url":"https://github.com/OctopusDeploy.png","language":"Go","readme":"# 🐙 Terraform Provider for Octopus Deploy\n\n## About\n\nThis repository contains the source code for the Terraform Provider for [Octopus Deploy](https://octopus.com). It supports provisioning/configuring of Octopus Deploy instances via [Terraform](https://www.terraform.io/). Documentation and guides for using this provider are located on the Terraform Registry: [Documentation](https://registry.terraform.io/providers/OctopusDeploy/octopusdeploy/latest/docs).\n\n## 🪄 Installation and Configuration\n\nThe Terraform Provider for Octopus Deploy is available via the Terraform Registry: [OctopusDeploy/octopusdeploy](https://registry.terraform.io/providers/OctopusDeploy/octopusdeploy). To install this provider, copy and paste this code into your Terraform configuration:\n\n```hcl\nterraform {\n  required_providers {\n    octopusdeploy = {\n      source = \"OctopusDeploy/octopusdeploy\"\n      version = \"version-number\" # example: 1.0.0\n    }\n  }\n}\n\nprovider \"octopusdeploy\" {\n  # configuration options\n  address  = \"https://octopus.example.com\"     # (required; string) the service endpoint of the Octopus REST API\n  api_key  = \"API-XXXXXXXXXXXXX\"               # (required; string) the API key to use with the Octopus REST API\n  space_id = \"Spaces-1\"                        # (optional; string) the space ID in Octopus Deploy\n}\n```\n\nIf `space_id` is not specified the Terraform Provider for Octopus Deploy will assume the default space.\n\n### Environment Variables\n\nYou can provide your Octopus Server configuration via the `OCTOPUS_URL` and `OCTOPUS_APIKEY` environment variables, representing your Octopus Server address and API Key, respectively.\n\n```hcl\nprovider \"octopusdeploy\" {}\n```\n\nRun `terraform init` to initialize this provider and enable resource management.\n\n## 🛠 Build Instructions\n\nA build of this Terraform Provider can be created using the [Makefile](https://github.com/OctopusDeploy/terraform-provider-octopusdeploy/blob/main/Makefile) provided in the source:\n\n```shell\n$ make\n```\n\nThis will generate a binary that will be installed to the local plugins' folder. Once installed, the provider may be used through the following configuration:\n\n```hcl\nterraform {\n  required_providers {\n    octopusdeploy = {\n      source  = \"octopus.com/com/octopusdeploy\"\n      version = \"0.7.63\"\n    }\n  }\n}\n\nprovider \"octopusdeploy\" {\n  address  = # address\n  api_key  = # API key\n  space_id = # space ID\n}\n```\n\nAfter the provider has been built and saved to the local plugins folder, it may be used after initialization:\n\n```shell\n$ terraform init\n```\n\nTerraform will scan the local plugins folder directory structure (first) to qualify the source name provided in your Terraform configuration. If it can resolve this name then the local copy will be initialized for use with Terraform. Otherwise, it will scan the Terraform Registry.\n\n:warning: The `version` number specified in your Terraform configuration MUST match the version number specified in the Makefile. Futhermore, this version MUST either be incremented for each local re-build; otherwise, Terraform will use the cached version of the provider in the `.terraform` folder. Alternatively, you can simply delete the folder and re-run the `terraform init` command.\n\n## Create a New Resource\n\n\u003e [!IMPORTANT]\n\u003e We're currently migrating all resources and data sources from Terraform SDK to Terraform Plugin Framework.\n\u003e \n\u003e All new resources should be created using Framework, in the `octopusdeploy-framework` directory. [A GitHub action](.github/workflows/prevent-new-sdk-additions.yml) will detect and prevent any new additions to the old `octopusdeploy` SDK directory.\n\n### Acceptance tests\nAll new resources need an acceptance test that will ensure the lifecycle of the resource works correctly this includes Create, Read, Update and Delete.\n\n### Blocks\n\u003e [!WARNING]\n\u003e Please avoid using [blocks](https://developer.hashicorp.com/terraform/plugin/framework/handling-data/blocks): these are mainly used for backwards compatability of resources migrated from SDK. Use [nested attributes](https://developer.hashicorp.com/terraform/plugin/framework/handling-data/attributes#nested-attribute-types) instead.\n\n### Compatibility with Server\nIf a resource is not compatible with older versions of the Octopus Deploy server or requires specific feature flags to be enabled, ensure that these requirements are clearly enforced with appropriate validation and descriptive error messaging.\n\nFor example to prevent resource usage in versions earlier than 2025.1:\n```go\nfunc (f *deploymentFreezeResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {\n  f.Config = ResourceConfiguration(req, resp)\n\n  if f.Config != nil {\n    diags := f.Config.EnsureResourceCompatibilityByVersion(deploymentFreezeResourceName, \"2025.1\")\n\tresp.Diagnostics.Append(diags...)\n  }\n}\n```\n\nTo prevent resource usage based on a feature flag \n```go\nfunc (f *deploymentFreezeResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {\n  f.Config = ResourceConfiguration(req, resp)\n\t\n  if f.Config != nil {\n\tdiags := f.Config.EnsureResourceCompatibilityByFeature(deploymentFreezeResourceName, \"ProjectDeploymentFreezesFeatureToggle\")\n\tresp.Diagnostics.Append(diags...)\n  }\n}\n```\n\n## Existing Resource\nWhen modifying an existing SDK resource, we strongly recommend migrating it to Framework first - but this might not always be feasible. We'll judge it on a case-by-case basis.  \nThe reason to not migrate is sometimes the resource is not compatible with framework without breaking changes. In this case a new resources needs to be created to replace the old one and the old one should become deprecated\n\n## Debugging \nIf you want to debug the provider follow these steps!\n\n### Prerequisites\n- Terraform provider is configured to use the local version e.g. `\"octopus.com/com/octopusdeploy\"`\n```hcl\nterraform {\n  required_providers {\n    octopusdeploy = {\n      source  = \"octopus.com/com/octopusdeploy\"\n      version = \"0.7.63\"\n    }\n  }\n}\n```\n- Optional - Install delve https://github.com/go-delve/delve\n\n### Via Goland\n1. Debug the provided run configuration `Run provider` - This will run the provider with the `-debug` flag set to true.\n2. Export the environment variable that the running provider logs out, it will look something like this:\n```shell\nTF_REATTACH_PROVIDERS='{\"octopus.com/com/octopusdeploy\":{\"Protocol\":\"grpc\",\"ProtocolVersion\":5,\"Pid\":37485,\"Test\":true,\"Addr\":{\"Network\":\"unix\",\"String\":\"/var/folders/pq/_cv_xzg97ts8t2tq25d_43wr0000gn/T/plugin447612806\"}}}'\n```\n3. In the same terminal session where you exported the environment variable, execute the Terraform commands you want to debug.\n\n### Via Delve\n1. Add your breakpoints, this can be done by adding `runtime.Breakpoint()` lines to where you want the code to break.\n2. Run `dlv debug . -- --debug` in the root folder of the project (same directory where `main.go` lives).\n3. The debugger will start and wait, type `continue` in the terminal to get it to start the provider.\n4. Export the environment variable that the running provider logs out, it will look something like this:\n```shell\nTF_REATTACH_PROVIDERS='{\"octopus.com/com/octopusdeploy\":{\"Protocol\":\"grpc\",\"ProtocolVersion\":5,\"Pid\":37485,\"Test\":true,\"Addr\":{\"Network\":\"unix\",\"String\":\"/var/folders/pq/_cv_xzg97ts8t2tq25d_43wr0000gn/T/plugin447612806\"}}}'\n```\n5. In the same terminal session where you exported the environment variable, execute the Terraform commands you want to debug.\n\n## Testing\n\n[Running integration tests](running-integration-tests-locally.md)\n\n## Documentation Generation\n\nDocumentation is auto-generated by the [tfplugindocs CLI](https://github.com/hashicorp/terraform-plugin-docs). To generate the documentation, run the following command:\n\n```shell\n$ make docs\n```\n\nor\n```shell\ngo generate main.go\n```\n\n## Releases\n\nThe release process is automated through GitHub Actions. To create a new release:\n\n1. Pull down the latest `main` branch with all merged changes\n2. Tag it with the appropriate version (v1.x.x), we use SemVer\n3. Push the tag and GitHub Actions will handle the rest\n\nThe repository uses [conventional commits](https://www.conventionalcommits.org/) for automated changelog generation. The generated changelogs provide a good starting point, but you can view and edit them directly on the [GitHub release page](https://github.com/OctopusDeploy/terraform-provider-octopusdeploy/releases) once published.\n\n## 🤝 Contributions\n\nContributions are welcome! :heart: Please read our [Contributing Guide](CONTRIBUTING.md) for information about how to get involved in this project.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctopusdeploy%2Fterraform-provider-octopusdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctopusdeploy%2Fterraform-provider-octopusdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctopusdeploy%2Fterraform-provider-octopusdeploy/lists"}