Skip to content

Commit

Permalink
Error out with a message if the user tries to disable IPv6 on a dropl…
Browse files Browse the repository at this point in the history
…et (#1105)

* Update resource_droplet.go

* Use ForceNewIfChange to force replacement

* remove line space
  • Loading branch information
danktec authored Feb 2, 2024
1 parent 91272bf commit 454dbdc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions digitalocean/droplet/resource_droplet.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ func ResourceDigitalOceanDroplet() *schema.Resource {
return d.Get("ipv6").(bool)
}),
),
// Forces replacement when IPv6 has attribute changes to `false`
// https://github.com/digitalocean/terraform-provider-digitalocean/issues/1104
customdiff.ForceNewIfChange("ipv6",
func(ctx context.Context, old, new, meta interface{}) bool {
return old.(bool) && !new.(bool)
},
),
),
}
}
Expand Down

0 comments on commit 454dbdc

Please sign in to comment.