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

provider errors when tfe_workspace_run_task is outside of terraform #1497

Open
ausmartway opened this issue Oct 19, 2024 · 2 comments
Open
Labels

Comments

@ausmartway
Copy link
Contributor

Terraform version

1.9.8

Terraform Configuration Files

data "tfe_workspace_ids" "customerfacing" {
  tag_names    = ["customerfacing"]
  organization = "REMOVED"
}
resource "tfe_workspace_run_task" "snyk" {
  for_each          = data.tfe_workspace_ids.customerfacing.ids
  workspace_id      = each.value
  task_id           = "REMOVED"
  enforcement_level = "advisory"
}

Debug Output

If any workspace associated with "customerfacing" tag is removed outside of terraform, then terraform refresh/plan/apply would fail with :

Error: Error reading Workspace Run Task
with tfe_workspace_run_task.snyk["asb-terraform-enterprise-azure-cdktf"]
on management-settings.tf line 372, in resource "tfe_workspace_run_task" "snyk":
resource "tfe_workspace_run_task" "snyk" {
Could not read Workspace Run Task, unexpected error: resource not found

Expected Behavior

If a previously managed resource was removed outside of terraform, the provider should consider the resource gone, it should then decide what to do based on what's in the code - create the resource if it still exists in code or just do nothing if code no longer exists.

Actual Behavior

the tfe provider erros and could not do refresh/plan and apply.

Additional Context

@ausmartway ausmartway added the bug label Oct 19, 2024
@ausmartway
Copy link
Contributor Author

I have tested the behaviour using the latest version(v0.59.0)

@glennsarti
Copy link
Contributor

This issue will be resolved in the next release (Nov 2024 release)

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

2 participants