|
|
|
@ -5,6 +5,7 @@ This module allows the creation and management of folders, including support for
|
|
|
|
|
<!-- BEGIN TOC -->
|
|
|
|
|
- [Basic example with IAM bindings](#basic-example-with-iam-bindings)
|
|
|
|
|
- [IAM](#iam)
|
|
|
|
|
- [Assured Workload Folder](#assured-workload-folder)
|
|
|
|
|
- [Organization policies](#organization-policies)
|
|
|
|
|
- [Organization Policy Factory](#organization-policy-factory)
|
|
|
|
|
- [Hierarchical Firewall Policy Attachments](#hierarchical-firewall-policy-attachments)
|
|
|
|
@ -55,6 +56,37 @@ The authoritative and additive approaches can be used together, provided differe
|
|
|
|
|
|
|
|
|
|
Refer to the [project module](../project/README.md#iam) for examples of the IAM interface.
|
|
|
|
|
|
|
|
|
|
## Assured Workload Folder
|
|
|
|
|
|
|
|
|
|
To create [Assured Workload](https://cloud.google.com/security/products/assured-workloads) folder instead of regular folder.
|
|
|
|
|
Note that an existing folder can not be converted to an Assured Workload folder, hence `assured_workload_config` is mutually exclusive with `folder_create=false`.
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
|
module "folder" {
|
|
|
|
|
source = "./fabric/modules/folder"
|
|
|
|
|
parent = var.folder_id
|
|
|
|
|
name = "Folder name"
|
|
|
|
|
|
|
|
|
|
assured_workload_config = {
|
|
|
|
|
compliance_regime = "EU_REGIONS_AND_SUPPORT"
|
|
|
|
|
display_name = "workload-name"
|
|
|
|
|
location = "europe-west1"
|
|
|
|
|
organization = var.organization_id
|
|
|
|
|
enable_sovereign_controls = true
|
|
|
|
|
}
|
|
|
|
|
iam = {
|
|
|
|
|
"roles/owner" = ["serviceAccount:${var.service_account.email}"]
|
|
|
|
|
}
|
|
|
|
|
iam_bindings_additive = {
|
|
|
|
|
am1-storage-admin = {
|
|
|
|
|
member = "serviceAccount:${var.service_account.email}"
|
|
|
|
|
role = "roles/storage.admin"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# tftest modules=1 resources=3 inventory=assured-workload.yaml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Organization policies
|
|
|
|
|
|
|
|
|
|
To manage organization policies, the `orgpolicy.googleapis.com` service should be enabled in the quota project.
|
|
|
|
@ -347,7 +379,7 @@ module "folder" {
|
|
|
|
|
|---|---|---|
|
|
|
|
|
| [iam.tf](./iam.tf) | IAM bindings. | <code>google_folder_iam_binding</code> · <code>google_folder_iam_member</code> |
|
|
|
|
|
| [logging.tf](./logging.tf) | Log sinks and supporting resources. | <code>google_bigquery_dataset_iam_member</code> · <code>google_folder_iam_audit_config</code> · <code>google_logging_folder_exclusion</code> · <code>google_logging_folder_settings</code> · <code>google_logging_folder_sink</code> · <code>google_project_iam_member</code> · <code>google_pubsub_topic_iam_member</code> · <code>google_storage_bucket_iam_member</code> |
|
|
|
|
|
| [main.tf](./main.tf) | Module-level locals and resources. | <code>google_compute_firewall_policy_association</code> · <code>google_essential_contacts_contact</code> · <code>google_folder</code> |
|
|
|
|
|
| [main.tf](./main.tf) | Module-level locals and resources. | <code>google_assured_workloads_workload</code> · <code>google_compute_firewall_policy_association</code> · <code>google_essential_contacts_contact</code> · <code>google_folder</code> |
|
|
|
|
|
| [organization-policies.tf](./organization-policies.tf) | Folder-level organization policies. | <code>google_org_policy_policy</code> |
|
|
|
|
|
| [outputs.tf](./outputs.tf) | Module outputs. | |
|
|
|
|
|
| [tags.tf](./tags.tf) | None | <code>google_tags_tag_binding</code> |
|
|
|
|
@ -360,30 +392,32 @@ module "folder" {
|
|
|
|
|
|
|
|
|
|
| name | description | type | required | default |
|
|
|
|
|
|---|---|:---:|:---:|:---:|
|
|
|
|
|
| [contacts](variables.tf#L17) | 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. | <code>map(list(string))</code> | | <code>{}</code> |
|
|
|
|
|
| [factories_config](variables.tf#L24) | Paths to data files and folders that enable factory functionality. | <code title="object({ org_policies = optional(string) })">object({…})</code> | | <code>{}</code> |
|
|
|
|
|
| [firewall_policy](variables.tf#L33) | Hierarchical firewall policy to associate to this folder. | <code title="object({ name = string policy = string })">object({…})</code> | | <code>null</code> |
|
|
|
|
|
| [folder_create](variables.tf#L42) | Create folder. When set to false, uses id to reference an existing folder. | <code>bool</code> | | <code>true</code> |
|
|
|
|
|
| [assured_workload_config](variables.tf#L17) | Create AssuredWorkloads folder instead of regular folder when value is provided. Incompatible with folder_create=false. | <code title="object({ compliance_regime = string display_name = string location = string organization = string enable_sovereign_controls = optional(bool) labels = optional(map(string), {}) partner = optional(string) partner_permissions = optional(object({ assured_workloads_monitoring = optional(bool) data_logs_viewer = optional(bool) service_access_approver = optional(bool) })) violation_notifications_enabled = optional(bool) })">object({…})</code> | | <code>null</code> |
|
|
|
|
|
| [contacts](variables.tf#L70) | 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. | <code>map(list(string))</code> | | <code>{}</code> |
|
|
|
|
|
| [factories_config](variables.tf#L77) | Paths to data files and folders that enable factory functionality. | <code title="object({ org_policies = optional(string) })">object({…})</code> | | <code>{}</code> |
|
|
|
|
|
| [firewall_policy](variables.tf#L86) | Hierarchical firewall policy to associate to this folder. | <code title="object({ name = string policy = string })">object({…})</code> | | <code>null</code> |
|
|
|
|
|
| [folder_create](variables.tf#L95) | Create folder. When set to false, uses id to reference an existing folder. | <code>bool</code> | | <code>true</code> |
|
|
|
|
|
| [iam](variables-iam.tf#L17) | IAM bindings in {ROLE => [MEMBERS]} format. | <code>map(list(string))</code> | | <code>{}</code> |
|
|
|
|
|
| [iam_bindings](variables-iam.tf#L24) | Authoritative IAM bindings in {KEY => {role = ROLE, members = [], condition = {}}}. Keys are arbitrary. | <code title="map(object({ members = list(string) role = string condition = optional(object({ expression = string title = string description = optional(string) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
|
|
|
|
| [iam_bindings_additive](variables-iam.tf#L39) | Individual additive IAM bindings. Keys are arbitrary. | <code title="map(object({ member = string role = string condition = optional(object({ expression = string title = string description = optional(string) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
|
|
|
|
| [iam_by_principals](variables-iam.tf#L54) | Authoritative IAM binding in {PRINCIPAL => [ROLES]} format. Principals need to be statically defined to avoid cycle errors. Merged internally with the `iam` variable. | <code>map(list(string))</code> | | <code>{}</code> |
|
|
|
|
|
| [id](variables.tf#L48) | Folder ID in case you use folder_create=false. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [id](variables.tf#L101) | Folder ID in case you use folder_create=false. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [logging_data_access](variables-logging.tf#L17) | Control activation of data access logs. Format is service => { log type => [exempted members]}. The special 'allServices' key denotes configuration for all services. | <code>map(map(list(string)))</code> | | <code>{}</code> |
|
|
|
|
|
| [logging_exclusions](variables-logging.tf#L32) | Logging exclusions for this folder in the form {NAME -> FILTER}. | <code>map(string)</code> | | <code>{}</code> |
|
|
|
|
|
| [logging_settings](variables-logging.tf#L39) | Default settings for logging resources. | <code title="object({ disable_default_sink = optional(bool) storage_location = optional(string) })">object({…})</code> | | <code>null</code> |
|
|
|
|
|
| [logging_sinks](variables-logging.tf#L49) | Logging sinks to create for the folder. | <code title="map(object({ bq_partitioned_table = optional(bool, false) description = optional(string) destination = string disabled = optional(bool, false) exclusions = optional(map(string), {}) filter = optional(string) iam = optional(bool, true) include_children = optional(bool, true) type = string }))">map(object({…}))</code> | | <code>{}</code> |
|
|
|
|
|
| [name](variables.tf#L54) | Folder name. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [org_policies](variables.tf#L60) | Organization policies applied to this folder keyed by policy name. | <code title="map(object({ inherit_from_parent = optional(bool) # for list policies only. reset = optional(bool) 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) # for boolean policies only. condition = optional(object({ description = optional(string) expression = optional(string) location = optional(string) title = optional(string) }), {}) })), []) }))">map(object({…}))</code> | | <code>{}</code> |
|
|
|
|
|
| [parent](variables.tf#L87) | Parent in folders/folder_id or organizations/org_id format. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [tag_bindings](variables.tf#L97) | Tag bindings for this folder, in key => tag value id format. | <code>map(string)</code> | | <code>null</code> |
|
|
|
|
|
| [name](variables.tf#L107) | Folder name. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [org_policies](variables.tf#L113) | Organization policies applied to this folder keyed by policy name. | <code title="map(object({ inherit_from_parent = optional(bool) # for list policies only. reset = optional(bool) 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) # for boolean policies only. condition = optional(object({ description = optional(string) expression = optional(string) location = optional(string) title = optional(string) }), {}) })), []) }))">map(object({…}))</code> | | <code>{}</code> |
|
|
|
|
|
| [parent](variables.tf#L140) | Parent in folders/folder_id or organizations/org_id format. | <code>string</code> | | <code>null</code> |
|
|
|
|
|
| [tag_bindings](variables.tf#L150) | Tag bindings for this folder, in key => tag value id format. | <code>map(string)</code> | | <code>null</code> |
|
|
|
|
|
|
|
|
|
|
## Outputs
|
|
|
|
|
|
|
|
|
|
| name | description | sensitive |
|
|
|
|
|
|---|---|:---:|
|
|
|
|
|
| [folder](outputs.tf#L17) | Folder resource. | |
|
|
|
|
|
| [id](outputs.tf#L22) | Fully qualified folder id. | |
|
|
|
|
|
| [name](outputs.tf#L33) | Folder name. | |
|
|
|
|
|
| [sink_writer_identities](outputs.tf#L38) | Writer identities created for each sink. | |
|
|
|
|
|
| [assured_workload](outputs.tf#L17) | Assured Workloads workload resource. | |
|
|
|
|
|
| [folder](outputs.tf#L22) | Folder resource. | |
|
|
|
|
|
| [id](outputs.tf#L27) | Fully qualified folder id. | |
|
|
|
|
|
| [name](outputs.tf#L38) | Folder name. | |
|
|
|
|
|
| [sink_writer_identities](outputs.tf#L47) | Writer identities created for each sink. | |
|
|
|
|
|
<!-- END TFDOC -->
|
|
|
|
|