You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importIdentityVal, evalDiags:=scope.EvalExpr(expr, cty.EmptyObject) // TODO get resource identity schema
91
+
diags=diags.Append(evalDiags)
92
+
93
+
ifimportIdentityVal.IsNull() {
94
+
returncty.NilVal, diags.Append(&hcl.Diagnostic{
95
+
Severity: hcl.DiagError,
96
+
Summary: "Invalid import identity argument",
97
+
Detail: "The import identity cannot be null.",
98
+
Subject: expr.Range().Ptr(),
99
+
})
100
+
}
101
+
if!allowUnknown&&!importIdentityVal.IsKnown() {
102
+
returncty.NilVal, diags.Append(&hcl.Diagnostic{
103
+
Severity: hcl.DiagError,
104
+
Summary: "Invalid import identity argument",
105
+
Detail: `The import block "identity" argument depends on resource attributes that cannot be determined until apply, so Terraform cannot plan to import this resource.`, // FIXME and what should I do about that?
106
+
Subject: expr.Range().Ptr(),
107
+
// Expression:
108
+
// EvalContext:
109
+
Extra: diagnosticCausedByUnknown(true),
110
+
})
111
+
}
112
+
113
+
// Import data may have marks, which we can discard because the id is only
114
+
// sent to the provider.
115
+
importIdentityVal, _=importIdentityVal.Unmark()
116
+
117
+
// TODO: Validate the object, ensure all required_for-import fields are present
0 commit comments