Skip to content

Commit 52519cc

Browse files
Merge pull request #5796 from cloudflare/vaishak/grit-page-rules
fix: grit pattern for state migration for page rules
2 parents 466dbca + a9c83d4 commit 52519cc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.grit/patterns/cloudflare_terraform_v5_attribute_renames_state.grit

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ pattern cloudflare_terraform_v5_attribute_renames_state() {
155155
contains `"plan": $_` => .
156156
}
157157
},
158-
159158
// cloudflare_access_policy & cloudflare_zero_trust_access_group
160159
`{ $..., "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
161160
$resource_type <: contains `cloudflare_access_policy`,
@@ -222,5 +221,18 @@ pattern cloudflare_terraform_v5_attribute_renames_state() {
222221
contains `"min_days_for_renewal": $_` => .
223222
}
224223
},
224+
// cloudflare_page_rule
225+
`{ $..., "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
226+
$resource_type <: contains `cloudflare_page_rule`,
227+
$instances <: any {
228+
contains `""` => `null`,
229+
contains `[]` => `null`,
230+
contains `false` => `null`,
231+
contains `0` => `null`,
232+
contains `"forwarding_url": []` => `"forwarding_url": null`,
233+
contains `"forwarding_url": [{"status_code": $status_code, "url": $url}]` => `"forwarding_url": {"status_code": $status_code, "url": $url}`,
234+
contains `"actions": [$action]` => `"actions": $action`
235+
}
236+
}
225237
}
226238
}

0 commit comments

Comments
 (0)