Terraform variables support
How Snyk IaC supports Terraform variables during scanning
Last updated
Was this helpful?
Was this helpful?
vpc.tf
resource "aws_security_group_rule" "ssh" {
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = [var.remote_user_addr]
security_group_id = aws_security_group.allow.id
}variables.tf
variable "remote_user_addr" {
type = string
default = "11.0.0.0/24"
}terraform.tfvars
remote_user_addr = "0.0.0.0/0"vpc.tf
resource "aws_security_group_rule" "ssh" {
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = local.test == 0 ? [var.remote_user_addr] : ["11.0.0.0/24"]
security_group_id = aws_security_group.allow.id
}
locals {
test = 0
}variables.tf
variable "remote_user_addr" {
type = string
default = "0.0.0.0/0"
}