Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

fix(terraform): convert input variables to expected type #1453

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

nikpivkin
Copy link
Collaborator

See aquasecurity/trivy#4997

The problem was that defsec did not convert variables to the expected type, which prevented variables of type set, map or object from being used as an argument to for_each. This PR adds conversion of input variable values to the expected type.

Also, defsec will now take into account the default values that the optional modifier sets if the value of a variable attribute is missing:

variable "policy_rules" {
  type = object({
    secure_tags = optional(map(object({
      session_matcher        = optional(string)
      priority               = number
      enabled                = optional(bool, true)
    })), {})
  })
}

@nikpivkin nikpivkin marked this pull request as ready for review September 14, 2023 12:37
@nikpivkin nikpivkin requested a review from simar7 as a code owner September 14, 2023 12:37
@simar7 simar7 added this pull request to the merge queue Sep 15, 2023
Merged via the queue into aquasecurity:master with commit 65798c7 Sep 15, 2023
@nikpivkin nikpivkin deleted the fix/convert-vars branch October 7, 2023 04:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants