Skip to content

Commit 04aee4e

Browse files
committed
ephemeral plan diags moved to validate
The improved handling of marks in functions has moved these diagnostics from plan to validate.
1 parent ac54255 commit 04aee4e

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

internal/terraform/context_plan_ephemeral_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ resource "test_object" "test" {
159159
}
160160
`,
161161
},
162-
expectPlanDiagnostics: func(m *configs.Config) (diags tfdiags.Diagnostics) {
162+
expectValidateDiagnostics: func(m *configs.Config) (diags tfdiags.Diagnostics) {
163163
return diags.Append(&hcl.Diagnostic{
164164
Severity: hcl.DiagError,
165165
Summary: "Invalid for_each argument",
@@ -205,7 +205,7 @@ module "child" {
205205
`,
206206
},
207207

208-
expectPlanDiagnostics: func(m *configs.Config) (diags tfdiags.Diagnostics) {
208+
expectValidateDiagnostics: func(m *configs.Config) (diags tfdiags.Diagnostics) {
209209
return diags.Append(&hcl.Diagnostic{
210210
Severity: hcl.DiagError,
211211
Summary: "Invalid for_each argument",
@@ -255,18 +255,13 @@ resource "test_object" "test" {
255255
}
256256
`,
257257
},
258-
expectPlanDiagnostics: func(m *configs.Config) (diags tfdiags.Diagnostics) {
258+
expectValidateDiagnostics: func(m *configs.Config) (diags tfdiags.Diagnostics) {
259259
return diags.Append(
260260
&hcl.Diagnostic{
261261
Severity: hcl.DiagError,
262262
Summary: "Invalid for_each argument",
263263
Detail: `The given "for_each" value is derived from an ephemeral value, which means that Terraform cannot persist it between plan/apply rounds. Use only non-ephemeral values to specify a resource's instance keys.`,
264264
},
265-
&hcl.Diagnostic{
266-
Severity: hcl.DiagError,
267-
Summary: "Invalid for_each argument",
268-
Detail: `The given "for_each" value is derived from an ephemeral value, which means that Terraform cannot persist it between plan/apply rounds. Use only non-ephemeral values to specify a resource's instance keys.`,
269-
},
270265
)
271266
},
272267
},

0 commit comments

Comments
 (0)