terraform-provider-tfe icon indicating copy to clipboard operation
terraform-provider-tfe copied to clipboard

tfe_workspace resource does not support auto-destroy features

Open jrbracey opened this issue 1 year ago • 4 comments

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

jrbracey avatar Nov 28 '23 15:11 jrbracey

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

resource "tfe_organization" "test-organization" {
  name  = "my-org-name"
  email = "[email protected]"
}

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?

thrashr888 avatar Jan 10 '24 01:01 thrashr888

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: @.***>

jrbracey avatar Jan 10 '24 03:01 jrbracey

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

thrashr888 avatar May 28 '24 17:05 thrashr888

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

thrashr888 avatar May 28 '24 17:05 thrashr888

Closing since all workspace auto-destroy features should be included in v0.57.0

notchairmk avatar Jul 18 '24 18:07 notchairmk