terraform-provider-azurecaf icon indicating copy to clipboard operation
terraform-provider-azurecaf copied to clipboard

Add support for updates to resource type(s)

Open owenfarrell opened this issue 2 years ago • 2 comments

Signed-off-by: Owen Farrell [email protected]

Fixes #140

PR Checklist


  • [x] I have read the CONTRIBUTING.MD instructions
  • [ ] I have changed the resourceDefinition.json
  • [ ] I have generated the resource model (there's a models_generated.go file in my PR)
  • [ ] I have updated the README.md#resource-status
  • [x] I have checked to ensure there aren't other open Pull Requests for the same update/change?

Description

Does this introduce a breaking change

  • [ ] YES
  • [x] NO

While this doesn't inherently introduce a backwards-breaking change, I don't see a way to support auto-upgrades of the current version of the provider to support this change. Anyone who attempts to auto-upgrade will incur the existing behavior (a forced deletion/recreation of downstream resources) one more time. Any suggestions on how to mitigate this issue would be appreciated.

Testing

In addition to local unit testing, I've exercised these updates via a local provider override and it seems to meet the need.

$ make build
go generate

2022/10/13 15:40:19 File generated
go fmt ./...
azurecaf/models_generated.go
azurecaf/provider_test.go
go build -o ./terraform-provider-azurecaf
go test ./...
?       github.com/aztfmod/terraform-provider-azurecaf  [no test files]
ok      github.com/aztfmod/terraform-provider-azurecaf/azurecaf 22.411s
?       github.com/aztfmod/terraform-provider-azurecaf/completness      [no test files]

owenfarrell avatar Oct 13 '22 20:10 owenfarrell

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Oct 26 '22 01:10 sonarqubecloud[bot]

In stewing on this a bit more, I took a crack at what an "auto-upgrade" approach looks like as part of #203. The idea is that it reverse engineers the random suffix that was generated based on existing result(s) using a guess-and-check approach.

owenfarrell avatar Nov 02 '22 16:11 owenfarrell

Closing as superseded by #203

arnaudlh avatar Nov 29 '22 10:11 arnaudlh