terraform-provider-scaleway
terraform-provider-scaleway copied to clipboard
scaleway_instance_server cloud_init updates
If I update the cloud init script - the virtual machine will be deleted and recreated. This behaviour is sometimes not wanted.
I would suggest to update the cloud_init block with the wanted behaviour.
Is:
resource "scaleway_instance_server" "server" {
cloud_init = var.cloud_init
}
Suggestion:
resource "scaleway_instance_server" "server" {
cloud_init {
script = var.cloud_init
update_behaviour = "ignore" // ignore, update, throw
}
}
I suggest the following options:
- Ignore Will do nothing
- Update Same behaviour as right now
- Throw Throws an error inside the plan/validate phase
I could help with the impl itself - but wanted to ask initialy ;)
Cheers, Patrik
Actually if I update the cloud-init script (which is in user_data, not in the root as your code snippet), that does nothing.
And I would like the resource to be recreated.
How did you manage to get the resource recreated?
Actually if I update the cloud-init script (which is in user_data, not in the root as your code snippet), that does nothing.
And I would like the resource to be recreated.
How did you manage to get the resource recreated?
I guess it is because @p3root is using images given by Scaleway (like image = "ubuntu_focal") ? The behavior is different than using a custom image.
This should be handled with our new resource resource_instance_user_data
. Please our documentation here