Originally posted by simar7 April 29, 2025
Description
In the following example since we don't know the value of the nested resource under evaluation, we are unable to evaluate the parent.
resource "aws_iam_role_policy" "ecs_firehose_delivery_role_policy" {
name = "${local.iam_policy_name}"
role = "${aws_iam_role.ecs_firehose_delivery_role.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:GetLogEvents",
"logs:PutLogEvents"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:put*",
"s3:get*",
"s3:list*"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"kinesis:DescribeStream",
"kinesis:GetRecords"
],
"Resource": [
"${aws_kinesis_stream.stepfunction_ecs_kinesis_stream.arn}"
]
}
]
}
EOF
}
Desired Behavior
Unclear of what the desired behaviour should be but maybe we could partially evaluate the resources that are known to us and ignore the unknown values out of it?
Actual Behavior
The entire parent block is ignored and not evaluated.
Reproduction Steps
1. trivy config main.tf
2. cat main.tf
resource "aws_iam_role_policy" "ecs_firehose_delivery_role_policy" {
name = "${local.iam_policy_name}"
role = "${aws_iam_role.ecs_firehose_delivery_role.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:GetLogEvents",
"logs:PutLogEvents"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:put*",
"s3:get*",
"s3:list*"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"kinesis:DescribeStream",
"kinesis:GetRecords"
],
"Resource": [
"${aws_kinesis_stream.stepfunction_ecs_kinesis_stream.arn}"
]
}
]
}
EOF
}
### Target
None
### Scanner
None
### Output Format
None
### Mode
None
### Debug Output
```bash
n/a
Operating System
all
Version
Checklist
Discussed in #8789
Originally posted by simar7 April 29, 2025
Description
In the following example since we don't know the value of the nested resource under evaluation, we are unable to evaluate the parent.
Desired Behavior
Unclear of what the desired behaviour should be but maybe we could partially evaluate the resources that are known to us and ignore the unknown values out of it?
Actual Behavior
The entire parent block is ignored and not evaluated.
Reproduction Steps
Operating System
all
Version
Checklist
trivy clean --all