@@ -42,6 +42,31 @@ locals {
4242 e2e_prefix = " tf-e2e-migrate"
4343}
4444
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+ # Summary of E2E Test Cases:
56+ # Total: 13 resource instances (1 + 1 + 1 + 1 + 2 + 2 + 2 + 1 + 1 + 1)
57+ #
58+ # Coverage:
59+ # - Deprecated resource name rename: 6 instances (deprecated_name, with_identifier, foreach_deprecated x2, primary, with_comments)
60+ # - Current resource name (no rename): 7 instances (current_name, no_interval, count_test x2, secondary, lifecycle_test)
61+ # - Identifier field removal: 1 instance (with_identifier)
62+ # - Different interval values: All instances (1h, 2h, 6h, 12h, 24h, 168h)
63+ # - Config block → attribute: All instances
64+ # - Count-based: 2 instances (count_test[0], count_test[1])
65+ # - for_each with map: 2 instances (foreach_deprecated["hourly"], foreach_deprecated["daily"])
66+ # - Cross-resource references: 2 instances (primary, secondary)
67+ # - Lifecycle meta-arguments: 1 instance (lifecycle_test)
68+ # - Comments preservation: 1 instance (with_comments)
69+
4570# Test Case 1: Deprecated resource name with all fields
4671# Tests: cloudflare_device_posture_integration → cloudflare_zero_trust_device_posture_integration rename
4772# Tests: config block → attribute transformation
@@ -59,6 +84,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "deprecated_name" {
5984 }
6085}
6186
87+ moved {
88+ from = cloudflare_device_posture_integration. deprecated_name
89+ to = cloudflare_zero_trust_device_posture_integration. deprecated_name
90+ }
91+
6292# Test Case 2: Current resource name with all fields
6393# Tests: No resource name change (already using current name)
6494# Tests: config block → attribute transformation
@@ -76,6 +106,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "current_name" {
76106 }
77107}
78108
109+ moved {
110+ from = cloudflare_device_posture_integration. current_name
111+ to = cloudflare_zero_trust_device_posture_integration. current_name
112+ }
113+
79114# Test Case 3: Non-standard interval value
80115# Tests: Various interval formats (not just 24h)
81116# Tests: config block → attribute transformation
@@ -93,6 +128,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "no_interval" {
93128 }
94129}
95130
131+ moved {
132+ from = cloudflare_device_posture_integration. no_interval
133+ to = cloudflare_zero_trust_device_posture_integration. no_interval
134+ }
135+
96136# Test Case 4: With deprecated identifier field
97137# Tests: identifier field is removed during migration
98138# Tests: Deprecated resource name → current name
@@ -111,6 +151,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "with_identifier" {
111151 }
112152}
113153
154+ moved {
155+ from = cloudflare_device_posture_integration. with_identifier
156+ to = cloudflare_zero_trust_device_posture_integration. with_identifier
157+ }
158+
114159# Test Case 5: Count-based resources
115160# Tests: Multiple resources with count
116161# Tests: Different interval values
@@ -131,6 +176,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "count_test" {
131176 }
132177}
133178
179+ moved {
180+ from = cloudflare_device_posture_integration. count_test
181+ to = cloudflare_zero_trust_device_posture_integration. count_test
182+ }
183+
134184# Test Case 6: for_each with map
135185# Tests: for_each with map iteration
136186# Tests: Variable interval values
@@ -154,6 +204,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "foreach_deprecated"
154204 }
155205}
156206
207+ moved {
208+ from = cloudflare_device_posture_integration. foreach_deprecated
209+ to = cloudflare_zero_trust_device_posture_integration. foreach_deprecated
210+ }
211+
157212# Test Case 7: Cross-resource reference
158213# Tests: References between resources work after migration
159214# Tests: Deprecated name → current name for referenced resource
@@ -171,6 +226,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "primary" {
171226 }
172227}
173228
229+ moved {
230+ from = cloudflare_device_posture_integration. primary
231+ to = cloudflare_zero_trust_device_posture_integration. primary
232+ }
233+
174234resource "cloudflare_zero_trust_device_posture_integration" "secondary" {
175235 account_id = var. cloudflare_account_id
176236 name = " ${ cloudflare_zero_trust_device_posture_integration . primary . name } -secondary"
@@ -185,6 +245,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "secondary" {
185245 }
186246}
187247
248+ moved {
249+ from = cloudflare_device_posture_integration. secondary
250+ to = cloudflare_zero_trust_device_posture_integration. secondary
251+ }
252+
188253# Test Case 8: Lifecycle meta-arguments
189254# Tests: Lifecycle blocks are preserved during migration
190255# Tests: config block → attribute transformation with lifecycle
@@ -206,6 +271,11 @@ resource "cloudflare_zero_trust_device_posture_integration" "lifecycle_test" {
206271 }
207272}
208273
274+ moved {
275+ from = cloudflare_device_posture_integration. lifecycle_test
276+ to = cloudflare_zero_trust_device_posture_integration. lifecycle_test
277+ }
278+
209279# Test Case 9: Comments preservation
210280# Tests: Comments are preserved during migration
211281resource "cloudflare_zero_trust_device_posture_integration" "with_comments" {
@@ -224,17 +294,7 @@ resource "cloudflare_zero_trust_device_posture_integration" "with_comments" {
224294 }
225295}
226296
227- # Summary of E2E Test Cases:
228- # Total: 13 resource instances (1 + 1 + 1 + 1 + 2 + 2 + 2 + 1 + 1 + 1)
229- #
230- # Coverage:
231- # - Deprecated resource name rename: 6 instances (deprecated_name, with_identifier, foreach_deprecated x2, primary, with_comments)
232- # - Current resource name (no rename): 7 instances (current_name, no_interval, count_test x2, secondary, lifecycle_test)
233- # - Identifier field removal: 1 instance (with_identifier)
234- # - Different interval values: All instances (1h, 2h, 6h, 12h, 24h, 168h)
235- # - Config block → attribute: All instances
236- # - Count-based: 2 instances (count_test[0], count_test[1])
237- # - for_each with map: 2 instances (foreach_deprecated["hourly"], foreach_deprecated["daily"])
238- # - Cross-resource references: 2 instances (primary, secondary)
239- # - Lifecycle meta-arguments: 1 instance (lifecycle_test)
240- # - Comments preservation: 1 instance (with_comments)
297+ moved {
298+ from = cloudflare_device_posture_integration. with_comments
299+ to = cloudflare_zero_trust_device_posture_integration. with_comments
300+ }
0 commit comments