Closed vparpoil closed 4 months ago
On solution would be to update the images after deprecation for this :
image_name = "Image not found"
But this is not satisfying
Hello @vparpoil,
Indeed the image name can be updated to indicate deprecations for example. To solve your issue, you should not rely on the image_name
but only on the image_id
, which is immutable.
You should use image_name
at instance creation but ignore it afterwards using ignore_changes
(https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes).
Hi @amstuta ,
Thanks for your answer. Indeed, ignore_changes
solves my issue.
I think those best practices should be highlighted in the docs , I didn't came with image_name
on my own ;)
Great :) You're right, the info has been raised to the right team and they will update the docs.
Describe the bug
I deployed an openstack_compute_instance_v2 with
image_name = "Ubuntu 22.04"
a few days ago. OVH deprecated the image on 18/04/2024 (it's shown in ovh manager UI:Ubuntu 22.04 - deprecated - 2024-04-18
) Running terraform now causes a replacement of the compute instance, which is not the expected behaviorThis is a blocking on using terraform to deploy and maintain OVH infra on the long run
Terraform Version
Terraform v1.7.1
OVH Terraform Provider Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
terraform plan gives
Expected Behavior
Since no change has been made to terraform, neither to the instance configuration, there should be no change