@@ -252,7 +252,7 @@ func optionalStringEnum[T ~string](block *terraform.Block, key string, def T, va
252252 tyAttr := block .GetAttribute (key )
253253 return "" , & hcl.Diagnostic {
254254 Severity : hcl .DiagError ,
255- Summary : fmt .Sprintf ("Invalid %q attribute" , key ),
255+ Summary : fmt .Sprintf ("Invalid %q attribute for block %s " , key , block . Label () ),
256256 Detail : err .Error (),
257257 Subject : & (tyAttr .HCLAttribute ().Range ),
258258 //Context: &(block.HCLBlock().DefRange),
@@ -275,7 +275,7 @@ func requiredString(block *terraform.Block, key string) (string, *hcl.Diagnostic
275275
276276 diag := & hcl.Diagnostic {
277277 Severity : hcl .DiagError ,
278- Summary : fmt .Sprintf ("Invalid %q attribute" , key ),
278+ Summary : fmt .Sprintf ("Invalid %q attribute for block %s " , key , block . Label () ),
279279 Detail : fmt .Sprintf ("Expected a string, got %q" , typeName ),
280280 Subject : & (tyAttr .HCLAttribute ().Range ),
281281 //Context: &(block.HCLBlock().DefRange),
@@ -393,7 +393,7 @@ func required(block *terraform.Block, keys ...string) hcl.Diagnostics {
393393 r := block .HCLBlock ().Body .MissingItemRange ()
394394 diags = diags .Append (& hcl.Diagnostic {
395395 Severity : hcl .DiagError ,
396- Summary : fmt .Sprintf ("Missing required attribute %q" , key ),
396+ Summary : fmt .Sprintf ("Missing required attribute %q for block %q " , key , block . Label () ),
397397 Detail : fmt .Sprintf ("The %s attribute is required" , key ),
398398 Subject : & r ,
399399 Extra : nil ,
0 commit comments