Replies: 2 comments 2 replies
-
|
@nikpivkin I can reproduce it on the latest main as well - could you take a look into it? |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Track #9834 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Trivy panics when trying to ignore a specific resource from a module when using
for_eachDesired Behavior
Ignore the specific resource from a module
Actual Behavior
Error: panic: value is unknown
Reproduction Steps
locals { aws-s3 = { bucket1 = { attach_policy = true policy = data.aws_iam_policy_document.policy1["dev"].json } bucket2 = { attach_policy = true policy = data.aws_iam_policy_document.policy2.json } } } data "aws_iam_policy_document" "policy1" { for_each = toset(["dev", "uat"]) statement { sid = "" effect = "Allow" actions = ["s3:GetObject"] resources = ["arn:aws:s3:::bucket1/*"] } } data "aws_iam_policy_document" "policy2" { statement { sid = "" effect = "Allow" actions = ["s3:GetObject"] resources = ["arn:aws:s3:::bucket2/*"] } } #trivy:ignore:AVD-AWS-0090[bucket=mybucket-bucket1] module "aws-s3" { source = "terraform-aws-modules/s3-bucket/aws" version = "~> 4.11.0" for_each = local.aws-s3 bucket = "mybucket-${each.key}" }I found that making only one of the following changes, then trivy won't panic:
#trivy:ignore:AVD-AWS-0090), then worksbucket = "${each.key}"), then worksbucket2(commenting/deleting) inlocals.aws-s3, then worksfor_eachon the bucket2 policy, (policy = data.aws_iam_policy_document.policy1["uat"].json), then worksOperating System
macOS Tahoe
Version
Checklist
trivy clean --allBeta Was this translation helpful? Give feedback.
All reactions