Skip to content

Commit 32951f9

Browse files
authored
chore: downgrade the failed block expand message to debug (aquasecurity#7964)
Signed-off-by: nikpivkin <[email protected]>
1 parent de3b7ea commit 32951f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/iac/scanners/terraform/parser/evaluator.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func (e *evaluator) expandBlocks(blocks terraform.Blocks) terraform.Blocks {
266266
func (e *evaluator) expandDynamicBlocks(blocks ...*terraform.Block) terraform.Blocks {
267267
for _, b := range blocks {
268268
if err := b.ExpandBlock(); err != nil {
269-
e.logger.Error(`Failed to expand dynamic block.`,
269+
e.logger.Debug(`Failed to expand dynamic block.`,
270270
log.String("block", b.FullName()), log.Err(err))
271271
}
272272
}
@@ -297,7 +297,7 @@ func (e *evaluator) expandBlockForEaches(blocks terraform.Blocks) terraform.Bloc
297297
forEachVal := forEachAttr.Value()
298298

299299
if forEachVal.IsNull() || !forEachVal.IsKnown() || !forEachAttr.IsIterable() {
300-
e.logger.Error(`Failed to expand block. Invalid "for-each" argument. Must be known and iterable.`,
300+
e.logger.Debug(`Failed to expand block. Invalid "for-each" argument. Must be known and iterable.`,
301301
log.String("block", block.FullName()),
302302
log.String("value", forEachVal.GoString()),
303303
)
@@ -314,7 +314,7 @@ func (e *evaluator) expandBlockForEaches(blocks terraform.Blocks) terraform.Bloc
314314
// instances are identified by a map key (or set member) from the value provided to for_each
315315
idx, err := convert.Convert(key, cty.String)
316316
if err != nil {
317-
e.logger.Error(
317+
e.logger.Debug(
318318
`Failed to expand block. Invalid "for-each" argument: map key (or set value) is not a string`,
319319
log.String("block", block.FullName()),
320320
log.String("key", key.GoString()),
@@ -331,7 +331,7 @@ func (e *evaluator) expandBlockForEaches(blocks terraform.Blocks) terraform.Bloc
331331
!forEachVal.Type().IsMapType() {
332332
stringVal, err := convert.Convert(val, cty.String)
333333
if err != nil {
334-
e.logger.Error(
334+
e.logger.Debug(
335335
"Failed to expand block. Invalid 'for-each' argument: value is not a string",
336336
log.String("block", block.FullName()),
337337
log.String("key", idx.AsString()),

0 commit comments

Comments
 (0)