latitudesh / terraform-provider-latitudesh

Latitude.sh Terraform Provider
https://registry.terraform.io/providers/latitudesh/latitudesh/latest/docs
Mozilla Public License 2.0
10 stars 4 forks source link

fix: force new on non updatable attributes #54

Closed ynhummel closed 11 months ago

ynhummel commented 11 months ago

What does this PR do?

When trying to update attributes that don't support it, Terraform will generate and successfully apply the plan without making any modifications at all. This can confuse users.

The best practice here is to set the non-updatable fields as ForceNew=True. Thus, when users change these attributes, Terraform will warn them that the change triggers the recreation of the entire resource.

Description of Task to be completed?

Set ForceNew=True in every non-updatable attribute

How should this be manually tested?

Clone the repository, checkout to this branch before proceeding

Them run make install to do a local installation of the provider.

Configure the provider

provider "latitudesh" { auth_token = }


and run `terraform init`. Now you are ready to start using terraform.

- Testing
This test can be done with all the resources that got modified. You can find the general structure that you'll need to use in our `examples` folder. More General instructions can be fount at: https://registry.terraform.io/providers/latitudesh/latitudesh/latest/docs.

After creating your resource files you can run `terraform plan` to verify terraforms action plan. In order to execute it you will need to run 'terraform apply' (in both commands an ssh key will be prompted, for this tests you can leave it blank and proceed)

After the apply operation, you can modify any field that isn't supposed to be updated, and terraform should warn you about the resource recreation.

**IMPORTANT**
After finishing your tests you should run terraform destroy to delete all the resources created.

#### Any background context you want to provide?

#### What are the relevant GitHub issues (if any)?
closes #44 

#### Screenshots (if appropriate):

#### Questions: