coder / coder/terraform-provider-coderd

resource `coderd_template` doesn't handle out-of-band change well

Open
#272 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
29
Forks
13
Avg merge
1d 20h
Merged PRs (30d)
20

Description

Provider Version: 0.0.12

If a template is deleted out-of-band, the provider requires 2 `terraform apply` calls. Not sure if this is by design, but on the first `terraform apply`, it already sees that the resource is missing. Instead of creating the template though, it returns `Template with ID **** not found. Marking as deleted.`, then fails with an inconsistent final plan. Applying changes a second time resolves this issue. Error below for reference:

```

│ Warning: Client Warning

│ with coderd_template.test,
│ on main.tf line 18, in resource "coderd_template" "test":
│ 18: resource "coderd_template" "test" {

│ Template with ID 640963de-4921-4195-aa08-2410d849874b not found. Marking as deleted.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for coderd_template.test to include new values learned so far during apply, provider
│ "registry.terraform.io/coder/coderd" produced an invalid new value for .versions[0].id: was known, but now unknown.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.