Fix an error message for import block with moved block (#33221)

Fixes #33220
This commit is contained in:
Masayuki Morita 2023-05-20 05:47:46 +09:00 committed by GitHub
parent 4015f1aa30
commit 53755180fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,7 +456,7 @@ func (m *Module) appendFile(file *File) hcl.Diagnostics {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Cannot import to a move source",
Detail: "An import block for ID %q targets resource address %s, but this address appears in the \"from\" argument of a moved block, which is invalid. Please change the import target to a different address, such as the move target.",
Detail: fmt.Sprintf("An import block for ID %q targets resource address %s, but this address appears in the \"from\" argument of a moved block, which is invalid. Please change the import target to a different address, such as the move target.", i.ID, i.To),
Subject: &i.DeclRange,
})
}