scottwinkler / terraform-provider-shell

Terraform provider for executing shell commands and saving output to state file
Mozilla Public License 2.0
279 stars 60 forks source link

Update semantics - is there a way to to replay replacement details? #125

Open cveld opened 1 year ago

cveld commented 1 year ago

Is there a way to relay to the terraform cli that a particular change on an input is triggering a replacement?

E.g. current state:

{
   "id": 3,
   "somereference": 4
}

The user changes somereference from 4 to 5 and runs a plan:

Message:

{
   "id": 3,
   "somereference": 4 -> 5 # causes replacement
}

In the current version I am using, I only see two ways:

  1. the read operation could return an error, faking that the resource does not exist and must be created freshly. Downside is that the original resource is not removed
  2. the update operation could replace the resource transparently. downside would be that the user is not expecting this based on the generated plan

Provider version: 1.7.10 terraform cli version: 1.4.6