coder / coder/terraform-provider-coderd
feat: Add force_delete option to coderd_organization resource
- Dominant language
- Go
- Stars
- 29
- Forks
- 13
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 20
Description
## Description
When a `coderd_organization` resource is destroyed, the deletion fails if the organization contains any resources (workspaces, templates, members, groups, or provisioner keys). This requires manual cleanup before Terraform can successfully remove the organization, which breaks the declarative infrastructure-as-code workflow.
## Current Behavior
```hcl
resource "coderd_organization" "example" {
name = "example-org"
}
```
## Expected Behavior
Add a force_delete attribute to the coderd_organization resource that cascades deletion to all organization resources when the organization is destroyed.
```hcl
resource "coderd_organization" "example" {
name = "example-org"
force_delete = true # Cascade delete all resources on destroy
}
```
## Dependencies
This feature depends on https://github.com/coder/coder/issues/21893, which adds force deletion support to the Coder API.
## Usecases
- Ephemeral environments: Spin up and tear down entire organizations for testing/demos
- Automated cleanup: CI/CD pipelines that create temporary organizations
- Full infrastructure management: Manage organizations entirely through Terraform without manual intervention
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.