Replies: 3 comments 10 replies
-
Thanks for reporting, I'll look into it. |
Beta Was this translation helpful? Give feedback.
-
@nikpivkin - could you take a look at this? |
Beta Was this translation helpful? Give feedback.
-
@simar7 A false positive result occurs due to the fact that the bucket name cannot be evaluated. If the default value for the variable is set to null, then here returns Execution of an expression with a ternary operator, where one of the operands of the result is null (var.bucket_name is null by default) ends with the following error: `The true and false result expression must have consistent types'. Example: variable "bucket_name" {
default = null
description = "Bucket name. If provided, the bucket will be created with this name instead of generating the name from the context"
}
resource "aws_s3_bucket" "example" {
bucket = var.bucket_name != null ? var.bucket_name : "default"
} |
Beta Was this translation helpful? Give feedback.
-
Description
Hey!
We use terraform module cloudposseterraform-aws-s3-bucket v3.1.2 in our configuration, but Trivy scan (that is run as a Trunk check) fails with the error we don't expect to see:
Both encryption and versioning are enabled and configured.
S3 bucket encryption is managed via the resource
aws_s3_bucket_server_side_encryption_configuration
.This is our state:
Similar for versioning, in the state our resource
aws_s3_bucket_versioning
looks like:Desired Behavior
Scan
trivy config main.tf
is successfully passed.Actual Behavior
Scan fails.
Reproduction Steps
Operating System
macOS Ventura
Version
Checklist
trivy --reset
Beta Was this translation helpful? Give feedback.
All reactions