diff --git a/.changelog/2486.txt b/.changelog/2486.txt new file mode 100644 index 0000000000..a5ed26780b --- /dev/null +++ b/.changelog/2486.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/cloudflare_list: remove `IsIPAddress` validation that doesn't take into account CIDR notation +``` diff --git a/internal/sdkv2provider/schema_cloudflare_list.go b/internal/sdkv2provider/schema_cloudflare_list.go index 0d97af90c1..679bd5f7c2 100644 --- a/internal/sdkv2provider/schema_cloudflare_list.go +++ b/internal/sdkv2provider/schema_cloudflare_list.go @@ -53,9 +53,8 @@ var listItemElem = &schema.Resource{ Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ip": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsIPAddress, + Type: schema.TypeString, + Optional: true, }, "redirect": { Type: schema.TypeList, diff --git a/internal/sdkv2provider/schema_cloudflare_list_item.go b/internal/sdkv2provider/schema_cloudflare_list_item.go index b38e52d7a0..72b51173a2 100644 --- a/internal/sdkv2provider/schema_cloudflare_list_item.go +++ b/internal/sdkv2provider/schema_cloudflare_list_item.go @@ -33,6 +33,7 @@ func resourceCloudflareListItemSchema() map[string]*schema.Schema { Description: "Autonomous system number to include in the list", ExactlyOneOf: []string{"ip", "redirect", "hostname", "asn"}, ForceNew: true, + ValidateFunc: validation.IntAtLeast(1), }, "hostname": { Type: schema.TypeList,