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

the_workspace_run has erratic apply and destroy behaviour #1219

Open
dejoost opened this issue Jan 18, 2024 · 0 comments
Open

the_workspace_run has erratic apply and destroy behaviour #1219

dejoost opened this issue Jan 18, 2024 · 0 comments
Labels

Comments

@dejoost
Copy link

dejoost commented Jan 18, 2024

Terraform Cloud/Enterprise version

Terraform Cloud Plus

Terraform version

1.6.6

Terraform Configuration Files

resource "tfe_workspace_run" "runs" {
  for_each     = var.workspaces
  workspace_id = tfe_workspace.workspace[each.key].id

  dynamic "apply" {
    for_each = each.value.queue_all_runs == false ? toset([]) : toset([1]) # apply if queue_all_runs is null or true
    content {
      manual_confirm    = false
      wait_for_run      = true
      retry_attempts    = 5
      retry_backoff_min = 5
    }
  }

  destroy {
    manual_confirm    = false
    wait_for_run      = true
    retry_attempts    = 3
    retry_backoff_min = 10
  }

}

Debug Output

See screenshot

Expected Behavior

After removing the resource from the configuration the run settings should be removed from the workspace without altering the workspace resources

Actual Behavior

a destroy plan is queued in the workspace and apply is stuck for several minutes and end with an error message, see screenshot.

Additional Context

we applied tfe_workspace_run on around 80 existing workspaces, 2 succeeded (after a long time, +1 hour), 8 got stuck at applying and the other workspaces got queued, pending apply. All plans were successful. The queued and applying runs had to be cancelled through the run api.

When removing the runs on the 2 workspaces where it succeeded we observed this behaviour.
Screenshot 2024-01-18 at 18 34 06

@dejoost dejoost added the bug label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant