Skip to content

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

@jatcod3r

Description

@jatcod3r

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions