2020-04-07 09:47:07 -07:00
/ * *
2022-01-01 06:52:31 -08:00
* Copyright 2022 Google LLC
2020-04-07 09:47:07 -07:00
*
* Licensed under the Apache License , Version 2 . 0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* http : //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS ,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
* /
2021-10-08 09:26:04 -07:00
variable " contacts " {
2022-01-31 01:45:34 -08:00
description = " List of essential contacts for this resource. Must be in the form EMAIL -> [NOTIFICATION_TYPES]. Valid notification types are ALL, SUSPENSION, SECURITY, TECHNICAL, BILLING, LEGAL, PRODUCT_UPDATES. "
2021-10-08 09:26:04 -07:00
type = map ( list ( string ) )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2021-10-08 09:26:04 -07:00
}
2020-04-07 09:47:07 -07:00
variable " custom_roles " {
description = " Map of role name => list of permissions to create in this project. "
type = map ( list ( string ) )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2020-04-07 09:47:07 -07:00
}
2021-10-08 09:26:04 -07:00
variable " firewall_policies " {
2021-12-12 23:41:02 -08:00
description = " Hierarchical firewall policy rules created in the organization. "
2021-10-08 09:26:04 -07:00
type = map ( map ( object ( {
2021-12-12 23:41:02 -08:00
action = string
2021-10-08 09:26:04 -07:00
description = string
direction = string
2021-12-12 23:41:02 -08:00
logging = bool
ports = map ( list ( string ) )
2021-10-08 09:26:04 -07:00
priority = number
ranges = list ( string )
target_resources = list ( string )
2021-12-12 23:41:02 -08:00
target_service_accounts = list ( string )
# preview = bool
2021-10-08 09:26:04 -07:00
} ) ) )
default = { }
}
2021-12-31 03:36:14 -08:00
variable " firewall_policy_association " {
description = " The hierarchical firewall policy to associate to this folder. Must be either a key in the `firewall_policies` map or the id of a policy defined somewhere else. "
2021-12-12 23:41:02 -08:00
type = map ( string )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2021-12-12 23:41:02 -08:00
}
variable " firewall_policy_factory " {
description = " Configuration for the firewall policy factory. "
type = object ( {
cidr_file = string
policy_name = string
rules_file = string
} )
default = null
2021-10-08 09:26:04 -07:00
}
2021-04-11 05:48:16 -07:00
variable " group_iam " {
description = " Authoritative IAM binding for organization groups, in {GROUP_EMAIL => [ROLES]} format. Group emails need to be static. Can be used in combination with the `iam` variable. "
type = map ( list ( string ) )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2021-04-11 05:48:16 -07:00
}
2020-11-04 06:44:28 -08:00
variable " iam " {
description = " IAM bindings, in {ROLE => [MEMBERS]} format. "
2020-04-07 09:47:07 -07:00
type = map ( list ( string ) )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2020-04-07 09:47:07 -07:00
}
2020-11-04 06:44:28 -08:00
variable " iam_additive " {
description = " Non authoritative IAM bindings, in {ROLE => [MEMBERS]} format. "
2020-04-07 09:47:07 -07:00
type = map ( list ( string ) )
2020-11-09 02:29:08 -08:00
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2020-11-09 02:29:08 -08:00
}
variable " iam_additive_members " {
description = " IAM additive bindings in {MEMBERS => [ROLE]} format. This might break if members are dynamic values. "
type = map ( list ( string ) )
2020-04-07 09:47:07 -07:00
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2020-04-07 09:47:07 -07:00
}
variable " iam_audit_config " {
description = " Service audit logging configuration. Service as key, map of log permission (eg DATA_READ) and excluded members as value for each service. "
type = map ( map ( list ( string ) ) )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2020-04-07 09:47:07 -07:00
# default = {
# allServices = {
# DATA_READ = ["user:me@example.org"]
# }
# }
}
2020-12-09 14:58:17 -08:00
variable " iam_audit_config_authoritative " {
description = " IAM Authoritative service audit logging configuration. Service as key, map of log permission (eg DATA_READ) and excluded members as value for each service. Audit config should also be authoritative when using authoritative bindings. Use with caution. "
type = map ( map ( list ( string ) ) )
default = null
# default = {
# allServices = {
# DATA_READ = ["user:me@example.org"]
# }
# }
}
2021-04-11 05:48:16 -07:00
variable " iam_bindings_authoritative " {
description = " IAM authoritative bindings, in {ROLE => [MEMBERS]} format. Roles and members not explicitly listed will be cleared. Bindings should also be authoritative when using authoritative audit config. Use with caution. "
type = map ( list ( string ) )
default = null
}
2021-10-08 09:26:04 -07:00
variable " logging_exclusions " {
description = " Logging exclusions for this organization in the form {NAME -> FILTER}. "
type = map ( string )
default = { }
2022-01-29 01:08:17 -08:00
nullable = false
2021-10-08 09:26:04 -07:00
}
variable " logging_sinks " {
description = " Logging sinks to create for this organization. "
type = map ( object ( {
2021-12-09 00:55:47 -08:00
destination = string
type = string
filter = string
include_children = bool
bq_partitioned_table = bool
2021-10-08 09:26:04 -07:00
# TODO exclusions also support description and disabled
exclusions = map ( string )
} ) )
2021-12-12 23:41:02 -08:00
validation {
condition = alltrue ( [
for k , v in ( var . logging_sinks == null ? { } : var . logging_sinks ) :
contains ( [ " bigquery " , " logging " , " pubsub " , " storage " ] , v . type )
] )
error_message = " Type must be one of 'bigquery', 'logging', 'pubsub', 'storage'. "
}
2022-01-29 01:08:17 -08:00
default = { }
nullable = false
2021-10-08 09:26:04 -07:00
}
2022-10-28 03:55:16 -07:00
variable " org_policies " {
description = " Organization policies applied to this organization keyed by policy name. "
2020-04-07 09:47:07 -07:00
type = map ( object ( {
2022-10-28 03:55:16 -07:00
inherit_from_parent = optional ( bool ) # for list policies only.
reset = optional ( bool )
# default (unconditional) values
allow = optional ( object ( {
all = optional ( bool )
values = optional ( list ( string ) )
} ) )
deny = optional ( object ( {
all = optional ( bool )
values = optional ( list ( string ) )
} ) )
enforce = optional ( bool , true ) # for boolean policies only.
# conditional values
rules = optional ( list ( object ( {
allow = optional ( object ( {
all = optional ( bool )
values = optional ( list ( string ) )
} ) )
deny = optional ( object ( {
all = optional ( bool )
values = optional ( list ( string ) )
} ) )
enforce = optional ( bool , true ) # for boolean policies only.
condition = object ( {
description = optional ( string )
expression = optional ( string )
location = optional ( string )
title = optional ( string )
} )
} ) ) , [ ] )
2020-04-07 09:47:07 -07:00
} ) )
2022-01-29 01:08:17 -08:00
default = { }
nullable = false
2020-04-07 09:47:07 -07:00
}
2022-02-20 02:14:18 -08:00
2022-10-28 08:27:33 -07:00
variable " organization_id " {
description = " Organization id in organizations/nnnnnn format. "
type = string
validation {
condition = can ( regex ( " ^organizations/[0-9]+ " , var . organization_id ) )
error_message = " The organization_id must in the form organizations/nnn. "
}
}
2022-11-03 03:41:53 -07:00
variable " org_policies_data_path " {
2022-11-03 04:31:42 -07:00
description = " Path containing org policies in YAML format. "
2022-11-03 03:41:53 -07:00
type = string
default = null
}
2022-02-20 02:14:18 -08:00
variable " tag_bindings " {
description = " Tag bindings for this organization, in key => tag value id format. "
type = map ( string )
default = null
}
variable " tags " {
description = " Tags by key name. The `iam` attribute behaves like the similarly named one at module level. "
type = map ( object ( {
description = string
iam = map ( list ( string ) )
values = map ( object ( {
description = string
iam = map ( list ( string ) )
} ) )
} ) )
default = null
}