I have a schema attribute like this :
Schema: map[string]*schema.Schema{
"safe_delete": {
Type: schema.TypeString,
Optional: true,
Description: "safely delete the resource",
Default: true,
},
basically this attribute comes into picture during destroy and the backing api/sdk doesn’t have this attribute.
On importing this, the value is null if its absent in the configuration and on next plan it is showing a change from null → true and I am getting this
cus_server: Refreshing state... [id=xxx-x-xxxxx-x]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# cus_server will be updated in-place
~ resource "cus_server" "ser1" {
id = "xxx-x-xxxxx-x"
name = "test-1"
+ safe_delete = true
# (18 unchanged attributes hidden)
# (3 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.