@@ -4,285 +4,211 @@ pattern cloudflare_terraform_v5_attribute_renames_state() {
4
4
any {
5
5
// clear out any previously defined schema bumps
6
6
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
7
- and {
8
- $resource_type <: r"^cloudflare_.*",
9
- $instances <: contains `"schema_version": $version`=> `"schema_version": 0`
7
+ $resource_type <: r"^cloudflare_.*",
8
+ $instances <: any {
9
+ contains `"schema_version": $version`=> `"schema_version": 0`
10
10
}
11
11
},
12
12
13
13
// cloudflare_api_token
14
14
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
15
- and {
16
- $resource_type <: contains `cloudflare_api_token`,
17
- $instances <: contains `"policy": $v ` => `"policies": $v `
15
+ $resource_type <: contains `cloudflare_api_token`,
16
+ $instances <: any {
17
+ contains `"policy": $policy ` => `"policies": $policy `
18
18
}
19
19
},
20
20
21
21
// cloudflare_account_member
22
22
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
23
- and {
24
- $resource_type <: contains `cloudflare_account_member`,
25
- $instances <: contains `"role_ids": $v` => `"roles": $v`
26
- }
27
- },
28
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
29
- and {
30
- $resource_type <: contains `cloudflare_account_member`,
31
- $instances <: contains `"email_address": $v` => `"email": $v`
23
+ $resource_type <: contains `cloudflare_account_member`,
24
+ $instances <: any {
25
+ contains `"role_ids": $roles` => `"roles": $roles`,
26
+ contains `"email_address": $ea` => `"email": $ea`,
32
27
}
33
28
},
34
29
35
30
// cloudflare_byo_ip_prefix
36
31
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
37
- and {
38
- $resource_type <: contains `cloudflare_byo_ip_prefix`,
39
- $instances <: contains `"advertisement": $v ` => `"advertised": $v `
32
+ $resource_type <: contains `cloudflare_byo_ip_prefix`,
33
+ $instances <: any {
34
+ contains `"advertisement": $ad ` => `"advertised": $ad `
40
35
}
41
36
},
42
37
43
38
// cloudflare_hostname_tls_setting
44
39
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
45
- and {
46
- $resource_type <: contains `cloudflare_hostname_tls_setting`,
47
- $instances <: contains `"setting": $v ` => `"setting_id": $v `
40
+ $resource_type <: contains `cloudflare_hostname_tls_setting`,
41
+ $instances <: any {
42
+ contains `"setting": $setting ` => `"setting_id": $setting `
48
43
}
49
44
},
50
45
51
46
// cloudflare_load_balancer
52
47
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
53
- and {
54
- $resource_type <: contains `cloudflare_load_balancer`,
55
- $instances <: contains `"fallback_pool_id": $v` => `"fallback_pool": $v`
56
- }
57
- },
58
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
59
- and {
60
- $resource_type <: contains `cloudflare_load_balancer`,
61
- $instances <: contains `"default_pool_ids": $v` => `"default_pools": $v`
48
+ $resource_type <: contains `cloudflare_load_balancer`,
49
+ $instances <: any {
50
+ contains `"fallback_pool_id": $fp` => `"fallback_pool": $fp`,
51
+ contains `"default_pool_ids": $dp` => `"default_pools": $dp`,
62
52
}
63
53
},
64
54
65
55
// cloudflare_queue
66
56
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
67
- and {
68
- $resource_type <: contains `cloudflare_queue`,
69
- $instances <: contains `"name": $v ` => `"queue_name": $v `
57
+ $resource_type <: contains `cloudflare_queue`,
58
+ $instances <: any {
59
+ contains `"name": $q ` => `"queue_name": $q `
70
60
}
71
61
},
72
62
73
63
// cloudflare_r2_bucket
74
64
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
75
- and {
76
- $resource_type <: contains `cloudflare_r2_bucket`,
77
- $instances <: contains `"location_hint": $v ` => `"location": $v `
65
+ $resource_type <: contains `cloudflare_r2_bucket`,
66
+ $instances <: any {
67
+ contains `"location_hint": $lh ` => `"location": $lh `
78
68
}
79
69
},
80
70
81
71
// cloudflare_worker_kv
82
72
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
83
- and {
84
- $resource_type <: contains `cloudflare_worker_kv`,
85
- $instances <: contains `"key": $v ` => `"key_name": $v `
73
+ $resource_type <: contains `cloudflare_worker_kv`,
74
+ $instances <: any {
75
+ contains `"key": $key ` => `"key_name": $key `
86
76
}
87
77
},
88
78
89
79
// cloudflare_logpull_retention
90
80
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
91
- and {
92
- $resource_type <: contains `cloudflare_logpull_retention`,
93
- $instances <: contains `"enabled": $v ` => `"flag": $v `
81
+ $resource_type <: contains `cloudflare_logpull_retention`,
82
+ $instances <: any {
83
+ contains `"enabled": $flag ` => `"flag": $flag `
94
84
}
95
85
},
96
86
97
87
// cloudflare_logpush_ownership_challenge
98
88
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
99
- and {
100
- $resource_type <: contains `cloudflare_logpush_ownership_challenge`,
101
- $instances <: contains `"ownership_challenge_filename": $v ` => `"filename": $v `
89
+ $resource_type <: contains `cloudflare_logpush_ownership_challenge`,
90
+ $instances <: any {
91
+ contains `"ownership_challenge_filename": $ocf ` => `"filename": $ocf `
102
92
}
103
93
},
104
94
105
95
// cloudflare_zero_trust_tunnel_cloudflared
106
96
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
107
- and {
108
- $resource_type <: contains `cloudflare_zero_trust_tunnel_cloudflared`,
109
- $instances <: contains `"secret": $v ` => `"tunnel_secret": $v `
97
+ $resource_type <: contains `cloudflare_zero_trust_tunnel_cloudflared`,
98
+ $instances <: any {
99
+ contains `"secret": $ts ` => `"tunnel_secret": $ts `
110
100
}
111
101
},
112
102
113
103
// cloudflare_zero_trust_access_short_lived_certificate
114
104
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
115
- and {
116
- $resource_type <: contains `cloudflare_zero_trust_access_short_lived_certificate`,
117
- $instances <: contains `"application_id": $v ` => `"app_id": $v `
105
+ $resource_type <: contains `cloudflare_zero_trust_access_short_lived_certificate`,
106
+ $instances <: any {
107
+ contains `"application_id": $app_id ` => `"app_id": $app_id `
118
108
}
119
109
},
120
110
121
111
// cloudflare_workers_secret
122
112
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
123
- and {
124
- $resource_type <: contains `cloudflare_workers_secret`,
125
- $instances <: contains `"secret_text": $v ` => `"text": $v `
113
+ $resource_type <: contains `cloudflare_workers_secret`,
114
+ $instances <: any {
115
+ contains `"secret_text": $st ` => `"text": $st `
126
116
}
127
117
},
128
118
129
119
// cloudflare_workers_kv
130
120
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
131
- and {
132
- $resource_type <: contains `cloudflare_workers_kv`,
133
- $instances <: contains `"key": $v ` => `"key_name": $v `
121
+ $resource_type <: contains `cloudflare_workers_kv`,
122
+ $instances <: any {
123
+ contains `"key": $kn ` => `"key_name": $kn `
134
124
}
135
125
},
136
126
137
127
// cloudflare_tiered_cache
138
128
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
139
- and {
140
- $resource_type <: contains `cloudflare_tiered_cache`,
141
- $instances <: contains `"cache_type": $v ` => `"value": $v `
129
+ $resource_type <: contains `cloudflare_tiered_cache`,
130
+ $instances <: any {
131
+ contains `"cache_type": $ct ` => `"value": $ct `
142
132
}
143
133
},
144
134
145
135
// cloudflare_zone
146
136
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
147
- and {
148
- $resource_type <: contains `cloudflare_zone`,
149
- $instances <: contains `"zone": $v` => `"name": $v`
150
- }
151
- },
152
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
153
- and {
154
- $resource_type <: contains `cloudflare_zone`,
155
- $instances <: contains `"account_id": $v` => `"account": {
156
- "id": $v
157
- }`
158
- }
159
- },
160
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
161
- and {
162
- $resource_type <: contains `cloudflare_zone`,
163
- $instances <: contains `"jump_start": $v` => .
164
- }
165
- },
166
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
167
- and {
168
- $resource_type <: contains `cloudflare_zone`,
169
- $instances <: contains `"plan": $v` => .
137
+ $resource_type <: contains `cloudflare_zone`,
138
+ $instances <: any {
139
+ contains `"zone": $z` => `"name": $z`,
140
+ contains `"account_id": $av` => `"account": {
141
+ "id": $av
142
+ }`,
143
+ contains `"jump_start": $_` => .,
144
+ contains `"plan": $_` => .
170
145
}
171
146
},
172
147
173
148
// cloudflare_access_policy & cloudflare_zero_trust_access_group
174
149
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
175
- and {
176
- $resource_type <: contains `cloudflare_access_policy`,
177
- $instances <: contains `"application_id": $v` => .
178
- }
179
- },
180
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
181
- and {
182
- $resource_type <: contains `cloudflare_access_policy`,
183
- $instances <: contains `"precedence": $v` => .
184
- }
185
- },
186
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
187
- and {
188
- $resource_type <: contains `cloudflare_zero_trust_access_group`,
189
- $instances <: contains `"application_id": $v` => .
150
+ $resource_type <: contains `cloudflare_access_policy`,
151
+ $instances <: any {
152
+ contains `"application_id": $_` => .,
153
+ contains `"precedence": $_` => .,
190
154
}
191
155
},
192
156
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
193
- and {
194
- $resource_type <: contains `cloudflare_zero_trust_access_group`,
195
- $instances <: contains `"precedence": $v` => .
157
+ $resource_type <: contains `cloudflare_zero_trust_access_group`,
158
+ $instances <: any {
159
+ contains `"application_id": $_` => .,
160
+ contains `"precedence": $_` => .,
196
161
}
197
162
},
198
163
199
164
// cloudflare_access_service_token & cloudflare_zero_trust_access_service_token
200
165
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
201
- and {
202
- $resource_type <: contains `cloudflare_access_service_token`,
203
- $instances <: contains `"min_days_for_renewal": $v ` => .
166
+ $resource_type <: contains `cloudflare_access_service_token`,
167
+ $instances <: any {
168
+ contains `"min_days_for_renewal": $_ ` => .,
204
169
}
205
170
},
206
171
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
207
- and {
208
- $resource_type <: contains `cloudflare_zero_trust_access_service_token`,
209
- $instances <: contains `"min_days_for_renewal": $v ` => .
172
+ $resource_type <: contains `cloudflare_zero_trust_access_service_token`,
173
+ $instances <: any {
174
+ contains `"min_days_for_renewal": $_ ` => .,
210
175
}
211
176
},
212
177
213
178
// cloudflare_tunnel & zero_trust_tunnel_cloudflared
214
179
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
215
- and {
216
- $resource_type <: contains `cloudflare_tunnel`,
217
- $instances <: contains `"secret": $v` => .
180
+ $resource_type <: contains `cloudflare_tunnel`,
181
+ $instances <: any {
182
+ contains `"secret": $_` => .,
183
+ contains `"cname": $_` => .,
218
184
}
219
185
},
220
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
221
- and {
222
- $resource_type <: contains `cloudflare_tunnel`,
223
- $instances <: contains `"cname": $v` => .
224
- }
225
- },
226
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
227
- and {
228
- $resource_type <: contains `zero_trust_tunnel_cloudflared`,
229
- $instances <: contains `"secret": $v` => .
230
- }
231
- },
232
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
233
- and {
234
- $resource_type <: contains `zero_trust_tunnel_cloudflared`,
235
- $instances <: contains `"cname": $v` => .
236
- }
237
- },
238
-
239
- // cloudflare_zone
240
186
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
241
- and {
242
- $resource_type <: contains `cloudflare_zone`,
243
- $instances <: contains `"plan": $v` => .
244
- }
245
- },
246
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
247
- and {
248
- $resource_type <: contains `cloudflare_zone`,
249
- $instances <: contains `"jump_start": $v` => .
187
+ $resource_type <: contains `zero_trust_tunnel_cloudflared`,
188
+ $instances <: any {
189
+ contains `"secret": $_` => .,
190
+ contains `"cname": $_` => .,
250
191
}
251
192
},
252
193
253
194
// cloudflare_record
254
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
255
- and {
256
- $resource_type <: contains `cloudflare_record`,
257
- $instances <: contains `"data": [{$obj}]` => `"data": {
258
- $obj
259
- }`
260
- }
261
- },
262
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
263
- and {
264
- $resource_type <: contains `cloudflare_record`,
265
- $instances <: contains `"data": []` => `"data": {}`
266
- }
267
- },
268
- `{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
269
- and {
270
- $resource_type <: contains `cloudflare_record`,
271
- $instances <: contains `"hostname": $v` => .
272
- }
273
- },
274
195
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
275
- and {
276
- $resource_type <: contains `cloudflare_record`,
277
- $instances <: contains `"allow_overwrite": $v` => .
196
+ $resource_type <: contains `cloudflare_record`,
197
+ $instances <: any {
198
+ contains `"data": [{$obj}]` => `"data": {
199
+ $obj
200
+ }`,
201
+ contains `"data": []` => `"data": {}`,
202
+ contains `"hostname": $_` => .,
203
+ contains `"allow_overwrite": $_` => .,
278
204
}
279
205
},
280
206
281
207
// cloudflare_origin_ca_certificate
282
208
`{ "mode": "managed", "type": "$resource_type", $..., "instances":[$instances] }` where {
283
- and {
284
- $resource_type <: contains `cloudflare_origin_ca_certificate`,
285
- $instances <: contains `"min_days_for_renewal": $v ` => .
209
+ $resource_type <: contains `cloudflare_origin_ca_certificate`,
210
+ $instances <: any {
211
+ contains `"min_days_for_renewal": $_ ` => .
286
212
}
287
213
},
288
214
}
0 commit comments