Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
When an instance is created with fully qualified SSH keys the tfstate file should store them as the fully qualified version and not just the key name. Upon an update to the infrastructure for other items the instance will want to destroyed and rebuilt because tfstate file doesn't match what's returned by REST API or what's in .tf file.
There is also some shenanigans around the order of the keys, but that's a trivial fix in the .tf file itself. Not saving the fully qualified in the tfstate is the bigger issue.
Terraform Version
Run
terraform -v
to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.Affected Resource(s)
Please list the resources as a list, for example:
- opc_compute_instance
Terraform Configuration Files
Expected Behavior
When an instance is created with fully qualified SSH keys the tfstate file should store them as the fully qualified version and not just the key name. Upon an update to the infrastructure for other items the instance will want to destroyed and rebuilt because tfstate file doesn't match what's returned by REST API or what's in .tf file.
In the the tfstate file the keys are stored as :
When a
plan
is run :Looking at output for the instance from the REST API :
There is also some shenanigans around the order of the keys, but that's a trivial fix in the .tf file itself. Not saving the fully qualified in the tfstate is the bigger issue.