You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module"google_compute_security_policy" {
source="./modules/google-beta/r/google_compute_security_policy"# description - (optional) is a type of stringdescription=null# name - (required) is a type of stringname=null# project - (optional) is a type of stringproject=nullrule=[{
action =null
description =null
match = [{
config = [{
src_ip_ranges = []
}]
expr = [{
expression =null
}]
versioned_expr =null
}]
preview =null
priority =null
}]
timeouts=[{
create =null
delete =null
update =null
}]
}
variable"description" {
description="(optional) - An optional description of this security policy. Max size is 2048."type=stringdefault=null
}
variable"name" {
description="(required) - The name of the security policy."type=string
}
variable"project" {
description="(optional) - The project in which the resource belongs. If it is not provided, the provider project is used."type=stringdefault=null
}
variable"rule" {
description="nested block: NestingSet, min items: 0, max items: 0"type=set(object(
{
action =string
description =string
match =list(object(
{
config =list(object(
{
src_ip_ranges =set(string)
}
))
expr =list(object(
{
expression =string
}
))
versioned_expr =string
}
))
preview =bool
priority =number
}
))
default=[]
}
variable"timeouts" {
description="nested block: NestingSingle, min items: 0, max items: 0"type=set(object(
{
create =string
delete =string
update =string
}
))
default=[]
}
resource"google_compute_security_policy""this" {
# description - (optional) is a type of stringdescription=var.description# name - (required) is a type of stringname=var.name# project - (optional) is a type of stringproject=var.projectdynamic"rule" {
for_each=var.rulecontent {
# action - (required) is a type of stringaction=rule.value["action"]
# description - (optional) is a type of stringdescription=rule.value["description"]
# preview - (optional) is a type of boolpreview=rule.value["preview"]
# priority - (required) is a type of numberpriority=rule.value["priority"]
dynamic"match" {
for_each=rule.value.matchcontent {
# versioned_expr - (optional) is a type of stringversioned_expr=match.value["versioned_expr"]
dynamic"config" {
for_each=match.value.configcontent {
# src_ip_ranges - (required) is a type of set of stringsrc_ip_ranges=config.value["src_ip_ranges"]
}
}
dynamic"expr" {
for_each=match.value.exprcontent {
# expression - (required) is a type of stringexpression=expr.value["expression"]
}
}
}
}
}
}
dynamic"timeouts" {
for_each=var.timeoutscontent {
# create - (optional) is a type of stringcreate=timeouts.value["create"]
# delete - (optional) is a type of stringdelete=timeouts.value["delete"]
# update - (optional) is a type of stringupdate=timeouts.value["update"]
}
}
}