With an old version of terraform you are going to face many more issues, and just like replace_triggered_by
a simple solution is available in a newer version; terraform is evolving very fast and constantly adding great new features, get the team to create plan to update often.
So if you are absolutely stuck and have to do it with the old version, your only option is to look at the source code of the resource you are working with, in your case is the oci_core_instance
and see what argument has the ForceNew
set to true, here is the code:
https://github.com/oracle/terraform-provider-oci/blob/master/internal/service/core/core_instance_resource.go#L29
func CoreInstanceResource() *schema.Resource {
return &schema.Resource{
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Timeouts: &schema.ResourceTimeout{
Create: tfresource.GetTimeoutDuration("45m"),
Update: tfresource.GetTimeoutDuration("45m"),
Delete: tfresource.GetTimeoutDuration("75m"),
},
Create: createCoreInstance,
Read: readCoreInstance,
Update: updateCoreInstance,
Delete: deleteCoreInstance,
Schema: map[string]*schema.Schema{
// Required
"availability_domain": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff,
},
"compartment_id": {
Type: schema.TypeString,
Required: true,
},
...
See there if availability_domain
changes it forces a new resource...
Then look for a way to incorporate the variable you need var.etcd_shape
in that argument, looking at all the arguments there maybe the ipxe_script
is something you can use just add that variable as a comment in the script.