hashicorp / terraform-provider-tfe

Official HCP Terraform and Terraform Enterprise provider, maintained by HashiCorp. Provision HCP Terraform or Terraform Enterprise - with Terraform!
https://registry.terraform.io/providers/hashicorp/tfe
Mozilla Public License 2.0
160 stars 151 forks source link

tfe_workspace resource does not support auto-destroy features #1157

Open jakebracey opened 7 months ago

jakebracey commented 7 months ago

Terraform Cloud

Terraform version

v1.5.7

Terraform Configuration Files

resource "tfe_workspace" "test" {
  name         = "my-workspace-name"
  organization = "my-organization-name"
}

Debug Output

N/A

Expected Behavior

We manage terraform cloud workspaces completely with this provider. We would like to manage the auto-destroy features.

Actual Behavior

When managing the tfe_workspace resource, we are unable to set auto-destroy setting to enable destroy at a specific time or if inactive after a set period of time.

Additional Context

thrashr888 commented 6 months ago

Hi! We're planning on adding this soon. It might look something like this:

resource "tfe_organization" "test-organization" {
  name  = "my-org-name"
  email = "admin@company.com"
}

resource "tfe_workspace" "test" {
  name                           = "my-workspace-name"
  organization                   = tfe_organization.test-organization.name
  auto-destroy-activity-duration = "18h"
}

And it might be easier to set it at the project level instead, like so:

resource "tfe_project" "test" {
  organization = tfe_organization.test-organization.name
  name = "projectname"
  auto-destroy-activity-duration = "18h"
}

Would that work for you?

jakebracey commented 6 months ago

That would be great. I manage our organization at the workspace level so not as worried about the project setting.

Jake

On Tue, Jan 9, 2024 at 18:29 Paul Thrasher @.***> wrote:

Hi! We're planning on adding this soon. It might look something like this:

resource "tfe_organization" "test-organization" { name = "my-org-name" email = @.***" } resource "tfe_workspace" "test" { name = "my-workspace-name" organization = tfe_organization.test-organization.name auto-destroy-activity-duration = "18h" }

And it might be easier to set it at the project level instead, like so:

resource "tfe_project" "test" { organization = tfe_organization.test-organization.name name = "projectname" auto-destroy-activity-duration = "18h" }

Would that work for you?

— Reply to this email directly, view it on GitHub https://github.com/hashicorp/terraform-provider-tfe/issues/1157#issuecomment-1884049243, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACR4NF4V5PXLQGYHC5ABNLLYNXVI5AVCNFSM6AAAAAA756TZAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBUGA2DSMRUGM . You are receiving this because you authored the thread.Message ID: @.***>

thrashr888 commented 1 month ago

Update: the dependency for this was merged last week https://github.com/hashicorp/go-tfe/pull/902

thrashr888 commented 1 month ago

This was also shipped last week. Duration setting will come next. https://github.com/hashicorp/terraform-provider-tfe/pull/1354