Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tfe_workspace_run] Allow configuration without apply and destroy blocks #1604

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tmatilai
Copy link
Contributor

Description

Allow configuring the tfe_workspace_run resource without apply and destroy blocks. This makes it possible to remove the destroy block from a resource without an apply block, to avoid a destroy run to be scheduled like when removing the whole resource.

This would be especially useful when managing workspaces and workspace runs with automation, allowing to leave the empty resources in state without worrying about accidental destroy runs.

Remember to:

  • Update the Change Log
  • Update the Documentation [No changes, the documentation doesn't say that at least one block is required]

Testing plan

Example configuration, which errors out without this change.

resource "tfe_workspace" "test" {
  name = "foo"
}

resource "tfe_workspace_run" "test" {
  workspace_id = tfe_workspace.test.id
}

Output from acceptance tests

[The test setup seems to have changed, disallowing running the test suite using own HCP Terraform organization]

$ TESTARGS="-run TestAccTFEWorkspaceRun" make testacc

...

… blocks

Allow configuring the `tfe_workspace_run` resource without `apply` and
`destroy` blocks. This makes it possible to remove the `destroy` block
from a resource without an `apply` block, to avoid a destroy run to be
scheduled like when removing the whole resource.
@tmatilai tmatilai requested a review from a team as a code owner February 12, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant