Add support for CMEK in logging bucket, big query dataset and gke notifications (#3558)

This commit is contained in:
Vannick Trinquier
2025-12-04 17:01:32 +07:00
committed by GitHub
parent ad9b71442a
commit 171a2c6690
23 changed files with 199 additions and 93 deletions

View File

@@ -353,27 +353,27 @@ module "bigquery-dataset" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [id](variables.tf#L111) | Dataset id. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L175) | Id of the project where datasets will be created. | <code>string</code> | ✓ | |
| [id](variables.tf#L112) | Dataset id. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L176) | Id of the project where datasets will be created. | <code>string</code> | ✓ | |
| [access](variables.tf#L17) | Map of access rules with role and identity type. Keys are arbitrary and must match those in the `access_identities` variable, types are `domain`, `group`, `special_group`, `user`, `view`. | <code title="map&#40;object&#40;&#123;&#10; role &#61; string&#10; type &#61; string&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [access_identities](variables.tf#L33) | Map of access identities used for basic access roles. View identities have the format 'project_id\|dataset_id\|table_id'. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [authorized_datasets](variables.tf#L39) | An array of datasets to be authorized on the dataset. | <code title="list&#40;object&#40;&#123;&#10; dataset_id &#61; string,&#10; project_id &#61; string,&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [authorized_routines](variables.tf#L48) | An array of routines to be authorized on the dataset. | <code title="list&#40;object&#40;&#123;&#10; project_id &#61; string,&#10; dataset_id &#61; string,&#10; routine_id &#61; string&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [authorized_views](variables.tf#L58) | An array of views to be authorized on the dataset. | <code title="list&#40;object&#40;&#123;&#10; dataset_id &#61; string,&#10; project_id &#61; string,&#10; table_id &#61; string &#35; this is the view id, but we keep table_id to stay consistent as the resource&#10;&#125;&#41;&#41;">list&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#91;&#93;</code> |
| [context](variables.tf#L68) | Context-specific interpolations. | <code title="object&#40;&#123;&#10; custom_roles &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; iam_principals &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; locations &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; project_ids &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; tag_values &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [dataset_access](variables.tf#L81) | Set access in the dataset resource instead of using separate resources. | <code>bool</code> | | <code>false</code> |
| [description](variables.tf#L87) | Optional description. | <code>string</code> | | <code>&#34;Terraform managed.&#34;</code> |
| [encryption_key](variables.tf#L93) | Self link of the KMS key that will be used to protect destination table. | <code>string</code> | | <code>null</code> |
| [friendly_name](variables.tf#L99) | Dataset friendly name. | <code>string</code> | | <code>null</code> |
| [iam](variables.tf#L105) | IAM bindings in {ROLE => [MEMBERS]} format. Mutually exclusive with the access_* variables used for basic roles. | <code>map&#40;list&#40;string&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [labels](variables.tf#L116) | Dataset labels. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [location](variables.tf#L122) | Dataset location. | <code>string</code> | | <code>&#34;EU&#34;</code> |
| [materialized_views](variables.tf#L128) | Materialized views definitions. | <code title="map&#40;object&#40;&#123;&#10; query &#61; string&#10; allow_non_incremental_definition &#61; optional&#40;bool&#41;&#10; deletion_protection &#61; optional&#40;bool&#41;&#10; description &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; enable_refresh &#61; optional&#40;bool&#41;&#10; friendly_name &#61; optional&#40;string&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; refresh_interval_ms &#61; optional&#40;bool&#41;&#10; require_partition_filter &#61; optional&#40;bool&#41;&#10; options &#61; optional&#40;object&#40;&#123;&#10; clustering &#61; optional&#40;list&#40;string&#41;&#41;&#10; expiration_time &#61; optional&#40;number&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; partitioning &#61; optional&#40;object&#40;&#123;&#10; field &#61; optional&#40;string&#41;&#10; range &#61; optional&#40;object&#40;&#123;&#10; end &#61; number&#10; interval &#61; number&#10; start &#61; number&#10; &#125;&#41;&#41;&#10; time &#61; optional&#40;object&#40;&#123;&#10; type &#61; string&#10; expiration_ms &#61; optional&#40;number&#41;&#10; field &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [options](variables.tf#L161) | Dataset options. | <code title="object&#40;&#123;&#10; default_collation &#61; optional&#40;string&#41;&#10; default_table_expiration_ms &#61; optional&#40;number&#41;&#10; default_partition_expiration_ms &#61; optional&#40;number&#41;&#10; delete_contents_on_destroy &#61; optional&#40;bool, false&#41;&#10; is_case_insensitive &#61; optional&#40;bool&#41;&#10; max_time_travel_hours &#61; optional&#40;number, 168&#41;&#10; storage_billing_model &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [routines](variables.tf#L180) | Routine definitions. | <code title="map&#40;object&#40;&#123;&#10; description &#61; optional&#40;string&#41;&#10; routine_type &#61; string&#10; language &#61; optional&#40;string&#41;&#10; definition_body &#61; string&#10; imported_libraries &#61; optional&#40;list&#40;string&#41;&#41;&#10; determinism_level &#61; optional&#40;string&#41;&#10; data_governance_type &#61; optional&#40;string&#41;&#10; return_type &#61; optional&#40;string&#41;&#10; return_table_type &#61; optional&#40;string&#41;&#10; arguments &#61; optional&#40;map&#40;object&#40;&#123;&#10; argument_kind &#61; optional&#40;string&#41;&#10; mode &#61; optional&#40;string&#41;&#10; data_type &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; spark_options &#61; optional&#40;object&#40;&#123;&#10; archive_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; connection &#61; string&#10; container_image &#61; optional&#40;string&#41;&#10; file_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; jar_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; main_file_uri &#61; optional&#40;string&#41;&#10; main_class &#61; optional&#40;string&#41;&#10; properties &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; py_file_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; runtime_version &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; remote_function_options &#61; optional&#40;object&#40;&#123;&#10; connection &#61; string&#10; endpoint &#61; optional&#40;string&#41;&#10; max_batching_rows &#61; optional&#40;string&#41;&#10; user_defined_context &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [tables](variables.tf#L219) | Table definitions. Options and partitioning default to null. Partitioning can only use `range` or `time`, set the unused one to null. | <code title="map&#40;object&#40;&#123;&#10; deletion_protection &#61; optional&#40;bool&#41;&#10; description &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; friendly_name &#61; optional&#40;string&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; require_partition_filter &#61; optional&#40;bool&#41;&#10; schema &#61; optional&#40;string&#41;&#10; external_data_configuration &#61; optional&#40;object&#40;&#123;&#10; autodetect &#61; bool&#10; source_uris &#61; list&#40;string&#41;&#10; avro_logical_types &#61; optional&#40;bool&#41;&#10; compression &#61; optional&#40;string&#41;&#10; connection_id &#61; optional&#40;string&#41;&#10; file_set_spec_type &#61; optional&#40;string&#41;&#10; ignore_unknown_values &#61; optional&#40;bool&#41;&#10; metadata_cache_mode &#61; optional&#40;string&#41;&#10; object_metadata &#61; optional&#40;string&#41;&#10; json_options_encoding &#61; optional&#40;string&#41;&#10; reference_file_schema_uri &#61; optional&#40;string&#41;&#10; schema &#61; optional&#40;string&#41;&#10; source_format &#61; optional&#40;string&#41;&#10; max_bad_records &#61; optional&#40;number&#41;&#10; csv_options &#61; optional&#40;object&#40;&#123;&#10; quote &#61; string&#10; allow_jagged_rows &#61; optional&#40;bool&#41;&#10; allow_quoted_newlines &#61; optional&#40;bool&#41;&#10; encoding &#61; optional&#40;string&#41;&#10; field_delimiter &#61; optional&#40;string&#41;&#10; skip_leading_rows &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; google_sheets_options &#61; optional&#40;object&#40;&#123;&#10; range &#61; optional&#40;string&#41;&#10; skip_leading_rows &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; hive_partitioning_options &#61; optional&#40;object&#40;&#123;&#10; mode &#61; optional&#40;string&#41;&#10; require_partition_filter &#61; optional&#40;bool&#41;&#10; source_uri_prefix &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; parquet_options &#61; optional&#40;object&#40;&#123;&#10; enum_as_string &#61; optional&#40;bool&#41;&#10; enable_list_inference &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10;&#10;&#10; &#125;&#41;&#41;&#10; options &#61; optional&#40;object&#40;&#123;&#10; clustering &#61; optional&#40;list&#40;string&#41;&#41;&#10; encryption_key &#61; optional&#40;string&#41;&#10; expiration_time &#61; optional&#40;number&#41;&#10; max_staleness &#61; optional&#40;string&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; partitioning &#61; optional&#40;object&#40;&#123;&#10; field &#61; optional&#40;string&#41;&#10; range &#61; optional&#40;object&#40;&#123;&#10; end &#61; number&#10; interval &#61; number&#10; start &#61; number&#10; &#125;&#41;&#41;&#10; time &#61; optional&#40;object&#40;&#123;&#10; type &#61; string&#10; expiration_ms &#61; optional&#40;number&#41;&#10; field &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; table_constraints &#61; optional&#40;object&#40;&#123;&#10; primary_key_columns &#61; optional&#40;list&#40;string&#41;&#41;&#10; foreign_keys &#61; optional&#40;object&#40;&#123;&#10; referenced_table &#61; object&#40;&#123;&#10; project_id &#61; string&#10; dataset_id &#61; string&#10; table_id &#61; string&#10; &#125;&#41;&#10; column_references &#61; object&#40;&#123;&#10; referencing_column &#61; string&#10; referenced_column &#61; string&#10; &#125;&#41;&#10; name &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [tag_bindings](variables.tf#L304) | Tag bindings for this dataset, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [views](variables.tf#L311) | View definitions. | <code title="map&#40;object&#40;&#123;&#10; query &#61; string&#10; deletion_protection &#61; optional&#40;bool&#41;&#10; description &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; friendly_name &#61; optional&#40;string&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; use_legacy_sql &#61; optional&#40;bool&#41;&#10; schema &#61; optional&#40;list&#40;object&#40;&#123;&#10; name &#61; string&#10; type &#61; string&#10; description &#61; string&#10; mode &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [context](variables.tf#L68) | Context-specific interpolations. | <code title="object&#40;&#123;&#10; custom_roles &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; kms_keys &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; iam_principals &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; locations &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; project_ids &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; tag_values &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [dataset_access](variables.tf#L82) | Set access in the dataset resource instead of using separate resources. | <code>bool</code> | | <code>false</code> |
| [description](variables.tf#L88) | Optional description. | <code>string</code> | | <code>&#34;Terraform managed.&#34;</code> |
| [encryption_key](variables.tf#L94) | Self link of the KMS key that will be used to protect destination table. | <code>string</code> | | <code>null</code> |
| [friendly_name](variables.tf#L100) | Dataset friendly name. | <code>string</code> | | <code>null</code> |
| [iam](variables.tf#L106) | IAM bindings in {ROLE => [MEMBERS]} format. Mutually exclusive with the access_* variables used for basic roles. | <code>map&#40;list&#40;string&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [labels](variables.tf#L117) | Dataset labels. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [location](variables.tf#L123) | Dataset location. | <code>string</code> | | <code>&#34;EU&#34;</code> |
| [materialized_views](variables.tf#L129) | Materialized views definitions. | <code title="map&#40;object&#40;&#123;&#10; query &#61; string&#10; allow_non_incremental_definition &#61; optional&#40;bool&#41;&#10; deletion_protection &#61; optional&#40;bool&#41;&#10; description &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; enable_refresh &#61; optional&#40;bool&#41;&#10; friendly_name &#61; optional&#40;string&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; refresh_interval_ms &#61; optional&#40;bool&#41;&#10; require_partition_filter &#61; optional&#40;bool&#41;&#10; options &#61; optional&#40;object&#40;&#123;&#10; clustering &#61; optional&#40;list&#40;string&#41;&#41;&#10; expiration_time &#61; optional&#40;number&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; partitioning &#61; optional&#40;object&#40;&#123;&#10; field &#61; optional&#40;string&#41;&#10; range &#61; optional&#40;object&#40;&#123;&#10; end &#61; number&#10; interval &#61; number&#10; start &#61; number&#10; &#125;&#41;&#41;&#10; time &#61; optional&#40;object&#40;&#123;&#10; type &#61; string&#10; expiration_ms &#61; optional&#40;number&#41;&#10; field &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [options](variables.tf#L162) | Dataset options. | <code title="object&#40;&#123;&#10; default_collation &#61; optional&#40;string&#41;&#10; default_table_expiration_ms &#61; optional&#40;number&#41;&#10; default_partition_expiration_ms &#61; optional&#40;number&#41;&#10; delete_contents_on_destroy &#61; optional&#40;bool, false&#41;&#10; is_case_insensitive &#61; optional&#40;bool&#41;&#10; max_time_travel_hours &#61; optional&#40;number, 168&#41;&#10; storage_billing_model &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [routines](variables.tf#L181) | Routine definitions. | <code title="map&#40;object&#40;&#123;&#10; description &#61; optional&#40;string&#41;&#10; routine_type &#61; string&#10; language &#61; optional&#40;string&#41;&#10; definition_body &#61; string&#10; imported_libraries &#61; optional&#40;list&#40;string&#41;&#41;&#10; determinism_level &#61; optional&#40;string&#41;&#10; data_governance_type &#61; optional&#40;string&#41;&#10; return_type &#61; optional&#40;string&#41;&#10; return_table_type &#61; optional&#40;string&#41;&#10; arguments &#61; optional&#40;map&#40;object&#40;&#123;&#10; argument_kind &#61; optional&#40;string&#41;&#10; mode &#61; optional&#40;string&#41;&#10; data_type &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; spark_options &#61; optional&#40;object&#40;&#123;&#10; archive_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; connection &#61; string&#10; container_image &#61; optional&#40;string&#41;&#10; file_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; jar_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; main_file_uri &#61; optional&#40;string&#41;&#10; main_class &#61; optional&#40;string&#41;&#10; properties &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; py_file_uris &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; runtime_version &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; remote_function_options &#61; optional&#40;object&#40;&#123;&#10; connection &#61; string&#10; endpoint &#61; optional&#40;string&#41;&#10; max_batching_rows &#61; optional&#40;string&#41;&#10; user_defined_context &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [tables](variables.tf#L220) | Table definitions. Options and partitioning default to null. Partitioning can only use `range` or `time`, set the unused one to null. | <code title="map&#40;object&#40;&#123;&#10; deletion_protection &#61; optional&#40;bool&#41;&#10; description &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; friendly_name &#61; optional&#40;string&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; require_partition_filter &#61; optional&#40;bool&#41;&#10; schema &#61; optional&#40;string&#41;&#10; external_data_configuration &#61; optional&#40;object&#40;&#123;&#10; autodetect &#61; bool&#10; source_uris &#61; list&#40;string&#41;&#10; avro_logical_types &#61; optional&#40;bool&#41;&#10; compression &#61; optional&#40;string&#41;&#10; connection_id &#61; optional&#40;string&#41;&#10; file_set_spec_type &#61; optional&#40;string&#41;&#10; ignore_unknown_values &#61; optional&#40;bool&#41;&#10; metadata_cache_mode &#61; optional&#40;string&#41;&#10; object_metadata &#61; optional&#40;string&#41;&#10; json_options_encoding &#61; optional&#40;string&#41;&#10; reference_file_schema_uri &#61; optional&#40;string&#41;&#10; schema &#61; optional&#40;string&#41;&#10; source_format &#61; optional&#40;string&#41;&#10; max_bad_records &#61; optional&#40;number&#41;&#10; csv_options &#61; optional&#40;object&#40;&#123;&#10; quote &#61; string&#10; allow_jagged_rows &#61; optional&#40;bool&#41;&#10; allow_quoted_newlines &#61; optional&#40;bool&#41;&#10; encoding &#61; optional&#40;string&#41;&#10; field_delimiter &#61; optional&#40;string&#41;&#10; skip_leading_rows &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; google_sheets_options &#61; optional&#40;object&#40;&#123;&#10; range &#61; optional&#40;string&#41;&#10; skip_leading_rows &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; hive_partitioning_options &#61; optional&#40;object&#40;&#123;&#10; mode &#61; optional&#40;string&#41;&#10; require_partition_filter &#61; optional&#40;bool&#41;&#10; source_uri_prefix &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; parquet_options &#61; optional&#40;object&#40;&#123;&#10; enum_as_string &#61; optional&#40;bool&#41;&#10; enable_list_inference &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10;&#10;&#10; &#125;&#41;&#41;&#10; options &#61; optional&#40;object&#40;&#123;&#10; clustering &#61; optional&#40;list&#40;string&#41;&#41;&#10; encryption_key &#61; optional&#40;string&#41;&#10; expiration_time &#61; optional&#40;number&#41;&#10; max_staleness &#61; optional&#40;string&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; partitioning &#61; optional&#40;object&#40;&#123;&#10; field &#61; optional&#40;string&#41;&#10; range &#61; optional&#40;object&#40;&#123;&#10; end &#61; number&#10; interval &#61; number&#10; start &#61; number&#10; &#125;&#41;&#41;&#10; time &#61; optional&#40;object&#40;&#123;&#10; type &#61; string&#10; expiration_ms &#61; optional&#40;number&#41;&#10; field &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; table_constraints &#61; optional&#40;object&#40;&#123;&#10; primary_key_columns &#61; optional&#40;list&#40;string&#41;&#41;&#10; foreign_keys &#61; optional&#40;object&#40;&#123;&#10; referenced_table &#61; object&#40;&#123;&#10; project_id &#61; string&#10; dataset_id &#61; string&#10; table_id &#61; string&#10; &#125;&#41;&#10; column_references &#61; object&#40;&#123;&#10; referencing_column &#61; string&#10; referenced_column &#61; string&#10; &#125;&#41;&#10; name &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [tag_bindings](variables.tf#L305) | Tag bindings for this dataset, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [views](variables.tf#L312) | View definitions. | <code title="map&#40;object&#40;&#123;&#10; query &#61; string&#10; deletion_protection &#61; optional&#40;bool&#41;&#10; description &#61; optional&#40;string, &#34;Terraform managed.&#34;&#41;&#10; friendly_name &#61; optional&#40;string&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; use_legacy_sql &#61; optional&#40;bool&#41;&#10; schema &#61; optional&#40;list&#40;object&#40;&#123;&#10; name &#61; string&#10; type &#61; string&#10; description &#61; string&#10; mode &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
## Outputs

View File

@@ -43,7 +43,8 @@ locals {
for kk, vv in v : "${local.ctx_p}${k}:${kk}" => vv
} if k != "condition_vars"
}
ctx_p = "$"
ctx_p = "$"
ctx_kms_keys = try(local.ctx.kms_keys, {})
identities_view = {
for k, v in local.access_view : k => try(
zipmap(
@@ -144,7 +145,11 @@ resource "google_bigquery_dataset" "default" {
dynamic "default_encryption_configuration" {
for_each = var.encryption_key == null ? [] : [""]
content {
kms_key_name = var.encryption_key
kms_key_name = lookup(
local.ctx_kms_keys,
var.encryption_key,
var.encryption_key
)
}
}
}
@@ -255,7 +260,11 @@ resource "google_bigquery_table" "default" {
dynamic "encryption_configuration" {
for_each = each.value.options.encryption_key != null ? [""] : []
content {
kms_key_name = each.value.options.encryption_key
kms_key_name = lookup(
local.ctx_kms_keys,
each.value.options.encryption_key,
each.value.options.encryption_key
)
}
}

View File

@@ -69,6 +69,7 @@ variable "context" {
description = "Context-specific interpolations."
type = object({
custom_roles = optional(map(string), {})
kms_keys = optional(map(string), {})
iam_principals = optional(map(string), {})
locations = optional(map(string), {})
project_ids = optional(map(string), {})

View File

@@ -10,6 +10,7 @@ This module offers a way to create and manage Google Kubernetes Engine (GKE) [Au
- [Backup for GKE](#backup-for-gke)
- [Allowing access from Google Cloud services](#allowing-access-from-google-cloud-services)
- [Disable PSC endpoint creation](#disable-psc-endpoint-creation)
- [Upgrade notifications](#upgrade-notifications)
- [Variables](#variables)
- [Outputs](#outputs)
<!-- END TOC -->
@@ -263,31 +264,57 @@ module "cluster-1" {
}
# tftest modules=1 resources=1 inventory=no-ip-access.yaml
```
## Upgrade notifications
Upgrade notifications are configured via the `enable_features.upgrade_notifications`. An existing PubSub topic can be defined via its `topic` attribute, or a new one can be created if the attribute is not set. The `event_types` attribute can be used to control which event types are sent. The `kms_key_name` attribute can be used to control which KMS key is used to encrypt the notification messages.
```hcl
module "cluster-1" {
source = "./fabric/modules/gke-cluster-autopilot"
project_id = var.project_id
name = "cluster-1"
location = "europe-west1"
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {}
}
enable_features = {
upgrade_notifications = {
event_types = ["SECURITY_BULLETIN_EVENT", "UPGRADE_EVENT"]
kms_key_name = "projects/myproject/locations/global/keyRings/mykeyring/cryptoKeys/mykey"
}
}
}
# tftest modules=1 resources=2 inventory=notifications.yaml
```
<!-- BEGIN TFDOC -->
## Variables
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [location](variables.tf#L172) | Autopilot clusters are always regional. | <code>string</code> | ✓ | |
| [name](variables.tf#L251) | Cluster name. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L284) | Cluster project ID. | <code>string</code> | ✓ | |
| [vpc_config](variables.tf#L300) | VPC-level configuration. | <code title="object&#40;&#123;&#10; disable_default_snat &#61; optional&#40;bool&#41;&#10; network &#61; string&#10; subnetwork &#61; string&#10; secondary_range_blocks &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;&#41;&#10; secondary_range_names &#61; optional&#40;object&#40;&#123;&#10; pods &#61; optional&#40;string&#41;&#10; services &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; additional_ranges &#61; optional&#40;list&#40;string&#41;&#41;&#10; stack_type &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | ✓ | |
| [location](variables.tf#L173) | Autopilot clusters are always regional. | <code>string</code> | ✓ | |
| [name](variables.tf#L252) | Cluster name. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L285) | Cluster project ID. | <code>string</code> | ✓ | |
| [vpc_config](variables.tf#L301) | VPC-level configuration. | <code title="object&#40;&#123;&#10; disable_default_snat &#61; optional&#40;bool&#41;&#10; network &#61; string&#10; subnetwork &#61; string&#10; secondary_range_blocks &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;&#41;&#10; secondary_range_names &#61; optional&#40;object&#40;&#123;&#10; pods &#61; optional&#40;string&#41;&#10; services &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; additional_ranges &#61; optional&#40;list&#40;string&#41;&#41;&#10; stack_type &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | ✓ | |
| [access_config](variables.tf#L17) | Control plane endpoint and nodes access configurations. | <code title="object&#40;&#123;&#10; dns_access &#61; optional&#40;bool, true&#41;&#10; ip_access &#61; optional&#40;object&#40;&#123;&#10; authorized_ranges &#61; optional&#40;map&#40;string&#41;&#41;&#10; disable_public_endpoint &#61; optional&#40;bool&#41;&#10; gcp_public_cidrs_access_enabled &#61; optional&#40;bool&#41;&#10; private_endpoint_authorized_ranges_enforcement &#61; optional&#40;bool&#41;&#10; private_endpoint_config &#61; optional&#40;object&#40;&#123;&#10; endpoint_subnetwork &#61; optional&#40;string&#41;&#10; global_access &#61; optional&#40;bool, true&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; private_nodes &#61; optional&#40;bool, true&#41;&#10; master_ipv4_cidr_block &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [backup_configs](variables.tf#L45) | Configuration for Backup for GKE. | <code title="object&#40;&#123;&#10; enable_backup_agent &#61; optional&#40;bool, false&#41;&#10; backup_plans &#61; optional&#40;map&#40;object&#40;&#123;&#10; encryption_key &#61; optional&#40;string&#41;&#10; include_secrets &#61; optional&#40;bool, true&#41;&#10; include_volume_data &#61; optional&#40;bool, true&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;&#41;&#10; namespaces &#61; optional&#40;list&#40;string&#41;&#41;&#10; permissive_mode &#61; optional&#40;bool&#41;&#10; region &#61; string&#10; schedule &#61; string&#10; retention_policy_days &#61; optional&#40;string&#41;&#10; retention_policy_lock &#61; optional&#40;bool, false&#41;&#10; retention_policy_delete_lock_days &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [deletion_protection](variables.tf#L67) | Whether or not to allow Terraform to destroy the cluster. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the cluster will fail. | <code>bool</code> | | <code>true</code> |
| [description](variables.tf#L74) | Cluster description. | <code>string</code> | | <code>null</code> |
| [enable_addons](variables.tf#L80) | Addons enabled in the cluster (true means enabled). | <code title="object&#40;&#123;&#10; cloudrun &#61; optional&#40;bool, false&#41;&#10; config_connector &#61; optional&#40;bool, false&#41;&#10; istio &#61; optional&#40;object&#40;&#123;&#10; enable_tls &#61; bool&#10; &#125;&#41;&#41;&#10; kalm &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [enable_features](variables.tf#L94) | Enable cluster-level features. Certain features allow configuration. | <code title="object&#40;&#123;&#10; beta_apis &#61; optional&#40;list&#40;string&#41;&#41;&#10; binary_authorization &#61; optional&#40;bool, false&#41;&#10; cost_management &#61; optional&#40;bool, true&#41;&#10; dns &#61; optional&#40;object&#40;&#123;&#10; additive_vpc_scope_dns_domain &#61; optional&#40;string&#41;&#10; provider &#61; optional&#40;string&#41;&#10; scope &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; multi_networking &#61; optional&#40;bool, false&#41;&#10; database_encryption &#61; optional&#40;object&#40;&#123;&#10; state &#61; string&#10; key_name &#61; string&#10; &#125;&#41;&#41;&#10; gateway_api &#61; optional&#40;bool, false&#41;&#10; groups_for_rbac &#61; optional&#40;string&#41;&#10; l4_ilb_subsetting &#61; optional&#40;bool, false&#41;&#10; mesh_certificates &#61; optional&#40;bool&#41;&#10; pod_security_policy &#61; optional&#40;bool, false&#41;&#10; rbac_binding_config &#61; optional&#40;object&#40;&#123;&#10; enable_insecure_binding_system_unauthenticated &#61; optional&#40;bool&#41;&#10; enable_insecure_binding_system_authenticated &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; secret_manager_config &#61; optional&#40;bool&#41;&#10; security_posture_config &#61; optional&#40;object&#40;&#123;&#10; mode &#61; string&#10; vulnerability_mode &#61; string&#10; &#125;&#41;&#41;&#10; allow_net_admin &#61; optional&#40;bool, false&#41;&#10; resource_usage_export &#61; optional&#40;object&#40;&#123;&#10; dataset &#61; string&#10; enable_network_egress_metering &#61; optional&#40;bool&#41;&#10; enable_resource_consumption_metering &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; service_external_ips &#61; optional&#40;bool, true&#41;&#10; tpu &#61; optional&#40;bool, false&#41;&#10; upgrade_notifications &#61; optional&#40;object&#40;&#123;&#10; enabled &#61; optional&#40;bool, true&#41;&#10; event_types &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; topic_id &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; vertical_pod_autoscaling &#61; optional&#40;bool, false&#41;&#10; enterprise_cluster &#61; optional&#40;bool&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [fleet_project](variables.tf#L154) | The name of the fleet host project where this cluster will be registered. | <code>string</code> | | <code>null</code> |
| [issue_client_certificate](variables.tf#L160) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
| [labels](variables.tf#L166) | Cluster resource labels. | <code>map&#40;string&#41;</code> | | <code>null</code> |
| [logging_config](variables.tf#L177) | Logging configuration. | <code title="object&#40;&#123;&#10; enable_api_server_logs &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_logs &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_logs &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [maintenance_config](variables.tf#L188) | Maintenance window configuration. | <code title="object&#40;&#123;&#10; daily_window_start_time &#61; optional&#40;string&#41;&#10; recurring_window &#61; optional&#40;object&#40;&#123;&#10; start_time &#61; string&#10; end_time &#61; string&#10; recurrence &#61; string&#10; &#125;&#41;&#41;&#10; maintenance_exclusions &#61; optional&#40;list&#40;object&#40;&#123;&#10; name &#61; string&#10; start_time &#61; string&#10; end_time &#61; string&#10; scope &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; daily_window_start_time &#61; &#34;03:00&#34;&#10; recurring_window &#61; null&#10; maintenance_exclusion &#61; &#91;&#93;&#10;&#125;">&#123;&#8230;&#125;</code> |
| [min_master_version](variables.tf#L211) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
| [monitoring_config](variables.tf#L217) | Monitoring configuration. System metrics collection cannot be disabled. Control plane metrics are optional. Kube state metrics are optional. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object&#40;&#123;&#10; enable_api_server_metrics &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_metrics &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_metrics &#61; optional&#40;bool, false&#41;&#10; enable_daemonset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_deployment_metrics &#61; optional&#40;bool, false&#41;&#10; enable_hpa_metrics &#61; optional&#40;bool, false&#41;&#10; enable_pod_metrics &#61; optional&#40;bool, false&#41;&#10; enable_statefulset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_storage_metrics &#61; optional&#40;bool, false&#41;&#10; enable_cadvisor_metrics &#61; optional&#40;bool, false&#41;&#10; enable_managed_prometheus &#61; optional&#40;bool, true&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_config](variables.tf#L256) | Configuration for nodes and nodepools. | <code title="object&#40;&#123;&#10; boot_disk_kms_key &#61; optional&#40;string&#41;&#10; service_account &#61; optional&#40;string&#41;&#10; tags &#61; optional&#40;list&#40;string&#41;&#41;&#10; workload_metadata_config_mode &#61; optional&#40;string&#41;&#10; kubelet_readonly_port_enabled &#61; optional&#40;bool&#41;&#10; resource_manager_tags &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_locations](variables.tf#L277) | Zones in which the cluster's nodes are located. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [release_channel](variables.tf#L289) | Release channel for GKE upgrades. Clusters created in the Autopilot mode must use a release channel. Choose between \"RAPID\", \"REGULAR\", and \"STABLE\". | <code>string</code> | | <code>&#34;REGULAR&#34;</code> |
| [enable_features](variables.tf#L94) | Enable cluster-level features. Certain features allow configuration. | <code title="object&#40;&#123;&#10; beta_apis &#61; optional&#40;list&#40;string&#41;&#41;&#10; binary_authorization &#61; optional&#40;bool, false&#41;&#10; cost_management &#61; optional&#40;bool, true&#41;&#10; dns &#61; optional&#40;object&#40;&#123;&#10; additive_vpc_scope_dns_domain &#61; optional&#40;string&#41;&#10; provider &#61; optional&#40;string&#41;&#10; scope &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; multi_networking &#61; optional&#40;bool, false&#41;&#10; database_encryption &#61; optional&#40;object&#40;&#123;&#10; state &#61; string&#10; key_name &#61; string&#10; &#125;&#41;&#41;&#10; gateway_api &#61; optional&#40;bool, false&#41;&#10; groups_for_rbac &#61; optional&#40;string&#41;&#10; l4_ilb_subsetting &#61; optional&#40;bool, false&#41;&#10; mesh_certificates &#61; optional&#40;bool&#41;&#10; pod_security_policy &#61; optional&#40;bool, false&#41;&#10; rbac_binding_config &#61; optional&#40;object&#40;&#123;&#10; enable_insecure_binding_system_unauthenticated &#61; optional&#40;bool&#41;&#10; enable_insecure_binding_system_authenticated &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; secret_manager_config &#61; optional&#40;bool&#41;&#10; security_posture_config &#61; optional&#40;object&#40;&#123;&#10; mode &#61; string&#10; vulnerability_mode &#61; string&#10; &#125;&#41;&#41;&#10; allow_net_admin &#61; optional&#40;bool, false&#41;&#10; resource_usage_export &#61; optional&#40;object&#40;&#123;&#10; dataset &#61; string&#10; enable_network_egress_metering &#61; optional&#40;bool&#41;&#10; enable_resource_consumption_metering &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; service_external_ips &#61; optional&#40;bool, true&#41;&#10; tpu &#61; optional&#40;bool, false&#41;&#10; upgrade_notifications &#61; optional&#40;object&#40;&#123;&#10; enabled &#61; optional&#40;bool, true&#41;&#10; event_types &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; topic_id &#61; optional&#40;string&#41;&#10; kms_key_name &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; vertical_pod_autoscaling &#61; optional&#40;bool, false&#41;&#10; enterprise_cluster &#61; optional&#40;bool&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [fleet_project](variables.tf#L155) | The name of the fleet host project where this cluster will be registered. | <code>string</code> | | <code>null</code> |
| [issue_client_certificate](variables.tf#L161) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
| [labels](variables.tf#L167) | Cluster resource labels. | <code>map&#40;string&#41;</code> | | <code>null</code> |
| [logging_config](variables.tf#L178) | Logging configuration. | <code title="object&#40;&#123;&#10; enable_api_server_logs &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_logs &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_logs &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [maintenance_config](variables.tf#L189) | Maintenance window configuration. | <code title="object&#40;&#123;&#10; daily_window_start_time &#61; optional&#40;string&#41;&#10; recurring_window &#61; optional&#40;object&#40;&#123;&#10; start_time &#61; string&#10; end_time &#61; string&#10; recurrence &#61; string&#10; &#125;&#41;&#41;&#10; maintenance_exclusions &#61; optional&#40;list&#40;object&#40;&#123;&#10; name &#61; string&#10; start_time &#61; string&#10; end_time &#61; string&#10; scope &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; daily_window_start_time &#61; &#34;03:00&#34;&#10; recurring_window &#61; null&#10; maintenance_exclusion &#61; &#91;&#93;&#10;&#125;">&#123;&#8230;&#125;</code> |
| [min_master_version](variables.tf#L212) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
| [monitoring_config](variables.tf#L218) | Monitoring configuration. System metrics collection cannot be disabled. Control plane metrics are optional. Kube state metrics are optional. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object&#40;&#123;&#10; enable_api_server_metrics &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_metrics &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_metrics &#61; optional&#40;bool, false&#41;&#10; enable_daemonset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_deployment_metrics &#61; optional&#40;bool, false&#41;&#10; enable_hpa_metrics &#61; optional&#40;bool, false&#41;&#10; enable_pod_metrics &#61; optional&#40;bool, false&#41;&#10; enable_statefulset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_storage_metrics &#61; optional&#40;bool, false&#41;&#10; enable_cadvisor_metrics &#61; optional&#40;bool, false&#41;&#10; enable_managed_prometheus &#61; optional&#40;bool, true&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_config](variables.tf#L257) | Configuration for nodes and nodepools. | <code title="object&#40;&#123;&#10; boot_disk_kms_key &#61; optional&#40;string&#41;&#10; service_account &#61; optional&#40;string&#41;&#10; tags &#61; optional&#40;list&#40;string&#41;&#41;&#10; workload_metadata_config_mode &#61; optional&#40;string&#41;&#10; kubelet_readonly_port_enabled &#61; optional&#40;bool&#41;&#10; resource_manager_tags &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_locations](variables.tf#L278) | Zones in which the cluster's nodes are located. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [release_channel](variables.tf#L290) | Release channel for GKE upgrades. Clusters created in the Autopilot mode must use a release channel. Choose between \"RAPID\", \"REGULAR\", and \"STABLE\". | <code>string</code> | | <code>&#34;REGULAR&#34;</code> |
## Outputs

View File

@@ -438,4 +438,5 @@ resource "google_pubsub_topic" "notifications" {
labels = {
content = "gke-notifications"
}
kms_key_name = try(var.enable_features.upgrade_notifications.kms_key_name, null)
}

View File

@@ -131,9 +131,10 @@ variable "enable_features" {
service_external_ips = optional(bool, true)
tpu = optional(bool, false)
upgrade_notifications = optional(object({
enabled = optional(bool, true)
event_types = optional(list(string), [])
topic_id = optional(string)
enabled = optional(bool, true)
event_types = optional(list(string), [])
topic_id = optional(string)
kms_key_name = optional(string)
}))
vertical_pod_autoscaling = optional(bool, false)
enterprise_cluster = optional(bool)

View File

@@ -225,7 +225,7 @@ module "cluster-1" {
## Upgrade notifications
Upgrade notifications are configured via the `enable_features.upgrade_notifications`. An existing PubSub topic can be defined via its `topic` attribute, or a new one can be created if the attribute is not set. The `event_types` attribute can be used to control which event types are sent.
Upgrade notifications are configured via the `enable_features.upgrade_notifications`. An existing PubSub topic can be defined via its `topic` attribute, or a new one can be created if the attribute is not set. The `event_types` attribute can be used to control which event types are sent. The `kms_key_name` attribute can be used to control which KMS key is used to encrypt the notification messages.
```hcl
module "cluster-1" {
@@ -240,7 +240,8 @@ module "cluster-1" {
}
enable_features = {
upgrade_notifications = {
event_types = ["SECURITY_BULLETIN_EVENT", "UPGRADE_EVENT"]
event_types = ["SECURITY_BULLETIN_EVENT", "UPGRADE_EVENT"]
kms_key_name = "projects/myproject/locations/global/keyRings/mykeyring/cryptoKeys/mykey"
}
}
}
@@ -510,10 +511,10 @@ module "cluster-1" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [location](variables.tf#L292) | Cluster zone or region. | <code>string</code> | ✓ | |
| [name](variables.tf#L407) | Cluster name. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L459) | Cluster project id. | <code>string</code> | ✓ | |
| [vpc_config](variables.tf#L470) | VPC-level configuration. | <code title="object&#40;&#123;&#10; disable_default_snat &#61; optional&#40;bool&#41;&#10; network &#61; string&#10; subnetwork &#61; string&#10; secondary_range_blocks &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;&#41;&#10; secondary_range_names &#61; optional&#40;object&#40;&#123;&#10; pods &#61; optional&#40;string&#41;&#10; services &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; additional_ranges &#61; optional&#40;list&#40;string&#41;&#41;&#10; stack_type &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | ✓ | |
| [location](variables.tf#L293) | Cluster zone or region. | <code>string</code> | ✓ | |
| [name](variables.tf#L408) | Cluster name. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L460) | Cluster project id. | <code>string</code> | ✓ | |
| [vpc_config](variables.tf#L471) | VPC-level configuration. | <code title="object&#40;&#123;&#10; disable_default_snat &#61; optional&#40;bool&#41;&#10; network &#61; string&#10; subnetwork &#61; string&#10; secondary_range_blocks &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;&#41;&#10; secondary_range_names &#61; optional&#40;object&#40;&#123;&#10; pods &#61; optional&#40;string&#41;&#10; services &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; additional_ranges &#61; optional&#40;list&#40;string&#41;&#41;&#10; stack_type &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | ✓ | |
| [access_config](variables.tf#L17) | Control plane endpoint and nodes access configurations. | <code title="object&#40;&#123;&#10; dns_access &#61; optional&#40;bool, true&#41;&#10; ip_access &#61; optional&#40;object&#40;&#123;&#10; authorized_ranges &#61; optional&#40;map&#40;string&#41;&#41;&#10; disable_public_endpoint &#61; optional&#40;bool&#41;&#10; gcp_public_cidrs_access_enabled &#61; optional&#40;bool&#41;&#10; private_endpoint_authorized_ranges_enforcement &#61; optional&#40;bool&#41;&#10; private_endpoint_config &#61; optional&#40;object&#40;&#123;&#10; endpoint_subnetwork &#61; optional&#40;string&#41;&#10; global_access &#61; optional&#40;bool, true&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; master_ipv4_cidr_block &#61; optional&#40;string&#41;&#10; private_nodes &#61; optional&#40;bool, true&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [backup_configs](variables.tf#L45) | Configuration for Backup for GKE. | <code title="object&#40;&#123;&#10; enable_backup_agent &#61; optional&#40;bool, false&#41;&#10; backup_plans &#61; optional&#40;map&#40;object&#40;&#123;&#10; region &#61; string&#10; applications &#61; optional&#40;map&#40;list&#40;string&#41;&#41;&#41;&#10; encryption_key &#61; optional&#40;string&#41;&#10; include_secrets &#61; optional&#40;bool, true&#41;&#10; include_volume_data &#61; optional&#40;bool, true&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;&#41;&#10; namespaces &#61; optional&#40;list&#40;string&#41;&#41;&#10; permissive_mode &#61; optional&#40;bool&#41;&#10; schedule &#61; optional&#40;string&#41;&#10; retention_policy_days &#61; optional&#40;number&#41;&#10; retention_policy_lock &#61; optional&#40;bool, false&#41;&#10; retention_policy_delete_lock_days &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [cluster_autoscaling](variables.tf#L68) | Enable and configure limits for Node Auto-Provisioning with Cluster Autoscaler. | <code title="object&#40;&#123;&#10; enabled &#61; optional&#40;bool, true&#41;&#10; autoscaling_profile &#61; optional&#40;string, &#34;BALANCED&#34;&#41;&#10; auto_provisioning_defaults &#61; optional&#40;object&#40;&#123;&#10; boot_disk_kms_key &#61; optional&#40;string&#41;&#10; disk_size &#61; optional&#40;number&#41;&#10; disk_type &#61; optional&#40;string, &#34;pd-standard&#34;&#41;&#10; image_type &#61; optional&#40;string&#41;&#10; oauth_scopes &#61; optional&#40;list&#40;string&#41;&#41;&#10; service_account &#61; optional&#40;string&#41;&#10; management &#61; optional&#40;object&#40;&#123;&#10; auto_repair &#61; optional&#40;bool, true&#41;&#10; auto_upgrade &#61; optional&#40;bool, true&#41;&#10; &#125;&#41;&#41;&#10; shielded_instance_config &#61; optional&#40;object&#40;&#123;&#10; integrity_monitoring &#61; optional&#40;bool, true&#41;&#10; secure_boot &#61; optional&#40;bool, false&#41;&#10; &#125;&#41;&#41;&#10; upgrade_settings &#61; optional&#40;object&#40;&#123;&#10; blue_green &#61; optional&#40;object&#40;&#123;&#10; node_pool_soak_duration &#61; optional&#40;string&#41;&#10; standard_rollout_policy &#61; optional&#40;object&#40;&#123;&#10; batch_percentage &#61; optional&#40;number&#41;&#10; batch_node_count &#61; optional&#40;number&#41;&#10; batch_soak_duration &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; surge &#61; optional&#40;object&#40;&#123;&#10; max &#61; optional&#40;number&#41;&#10; unavailable &#61; optional&#40;number&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;&#10; auto_provisioning_locations &#61; optional&#40;list&#40;string&#41;&#41;&#10; cpu_limits &#61; optional&#40;object&#40;&#123;&#10; min &#61; optional&#40;number, 0&#41;&#10; max &#61; number&#10; &#125;&#41;&#41;&#10; mem_limits &#61; optional&#40;object&#40;&#123;&#10; min &#61; optional&#40;number, 0&#41;&#10; max &#61; number&#10; &#125;&#41;&#41;&#10; accelerator_resources &#61; optional&#40;list&#40;object&#40;&#123;&#10; resource_type &#61; string&#10; min &#61; optional&#40;number, 0&#41;&#10; max &#61; number&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
@@ -521,19 +522,19 @@ module "cluster-1" {
| [deletion_protection](variables.tf#L166) | Whether or not to allow Terraform to destroy the cluster. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the cluster will fail. | <code>bool</code> | | <code>true</code> |
| [description](variables.tf#L173) | Cluster description. | <code>string</code> | | <code>null</code> |
| [enable_addons](variables.tf#L179) | Addons enabled in the cluster (true means enabled). | <code title="object&#40;&#123;&#10; cloudrun &#61; optional&#40;bool, false&#41;&#10; config_connector &#61; optional&#40;bool, false&#41;&#10; dns_cache &#61; optional&#40;bool, true&#41;&#10; gce_persistent_disk_csi_driver &#61; optional&#40;bool, true&#41;&#10; gcp_filestore_csi_driver &#61; optional&#40;bool, true&#41;&#10; gcs_fuse_csi_driver &#61; optional&#40;bool, true&#41;&#10; horizontal_pod_autoscaling &#61; optional&#40;bool, true&#41;&#10; http_load_balancing &#61; optional&#40;bool, true&#41;&#10; istio &#61; optional&#40;object&#40;&#123;&#10; enable_tls &#61; bool&#10; &#125;&#41;&#41;&#10; kalm &#61; optional&#40;bool, false&#41;&#10; network_policy &#61; optional&#40;bool, false&#41;&#10; stateful_ha &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [enable_features](variables.tf#L201) | Enable cluster-level features. Certain features allow configuration. | <code title="object&#40;&#123;&#10; beta_apis &#61; optional&#40;list&#40;string&#41;&#41;&#10; binary_authorization &#61; optional&#40;bool, false&#41;&#10; cilium_clusterwide_network_policy &#61; optional&#40;bool, false&#41;&#10; cost_management &#61; optional&#40;bool, true&#41;&#10; dns &#61; optional&#40;object&#40;&#123;&#10; additive_vpc_scope_dns_domain &#61; optional&#40;string&#41;&#10; provider &#61; optional&#40;string&#41;&#10; scope &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; multi_networking &#61; optional&#40;bool, false&#41;&#10; database_encryption &#61; optional&#40;object&#40;&#123;&#10; state &#61; string&#10; key_name &#61; string&#10; &#125;&#41;&#41;&#10; dataplane_v2 &#61; optional&#40;bool, true&#41;&#10; fqdn_network_policy &#61; optional&#40;bool, true&#41;&#10; gateway_api &#61; optional&#40;bool, false&#41;&#10; groups_for_rbac &#61; optional&#40;string&#41;&#10; image_streaming &#61; optional&#40;bool, false&#41;&#10; intranode_visibility &#61; optional&#40;bool, false&#41;&#10; l4_ilb_subsetting &#61; optional&#40;bool, false&#41;&#10; mesh_certificates &#61; optional&#40;bool&#41;&#10; pod_security_policy &#61; optional&#40;bool, false&#41;&#10; rbac_binding_config &#61; optional&#40;object&#40;&#123;&#10; enable_insecure_binding_system_unauthenticated &#61; optional&#40;bool&#41;&#10; enable_insecure_binding_system_authenticated &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; secret_manager_config &#61; optional&#40;bool&#41;&#10; security_posture_config &#61; optional&#40;object&#40;&#123;&#10; mode &#61; string&#10; vulnerability_mode &#61; string&#10; &#125;&#41;&#41;&#10; resource_usage_export &#61; optional&#40;object&#40;&#123;&#10; dataset &#61; string&#10; enable_network_egress_metering &#61; optional&#40;bool&#41;&#10; enable_resource_consumption_metering &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; service_external_ips &#61; optional&#40;bool, true&#41;&#10; shielded_nodes &#61; optional&#40;bool, false&#41;&#10; tpu &#61; optional&#40;bool, false&#41;&#10; upgrade_notifications &#61; optional&#40;object&#40;&#123;&#10; enabled &#61; optional&#40;bool, true&#41;&#10; event_types &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; topic_id &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; vertical_pod_autoscaling &#61; optional&#40;bool, false&#41;&#10; workload_identity &#61; optional&#40;bool, true&#41;&#10; enterprise_cluster &#61; optional&#40;bool&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [fleet_project](variables.tf#L273) | The name of the fleet host project where this cluster will be registered. | <code>string</code> | | <code>null</code> |
| [issue_client_certificate](variables.tf#L279) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
| [labels](variables.tf#L285) | Cluster resource labels. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [logging_config](variables.tf#L297) | Logging configuration. | <code title="object&#40;&#123;&#10; enable_system_logs &#61; optional&#40;bool, true&#41;&#10; enable_workloads_logs &#61; optional&#40;bool, false&#41;&#10; enable_api_server_logs &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_logs &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_logs &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [maintenance_config](variables.tf#L318) | Maintenance window configuration. | <code title="object&#40;&#123;&#10; daily_window_start_time &#61; optional&#40;string&#41;&#10; recurring_window &#61; optional&#40;object&#40;&#123;&#10; start_time &#61; string&#10; end_time &#61; string&#10; recurrence &#61; string&#10; &#125;&#41;&#41;&#10; maintenance_exclusions &#61; optional&#40;list&#40;object&#40;&#123;&#10; name &#61; string&#10; start_time &#61; string&#10; end_time &#61; string&#10; scope &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; daily_window_start_time &#61; &#34;03:00&#34;&#10; recurring_window &#61; null&#10; maintenance_exclusion &#61; &#91;&#93;&#10;&#125;">&#123;&#8230;&#125;</code> |
| [max_pods_per_node](variables.tf#L341) | Maximum number of pods per node in this cluster. | <code>number</code> | | <code>110</code> |
| [min_master_version](variables.tf#L347) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
| [monitoring_config](variables.tf#L353) | Monitoring configuration. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object&#40;&#123;&#10; enable_system_metrics &#61; optional&#40;bool, true&#41;&#10; enable_api_server_metrics &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_metrics &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_metrics &#61; optional&#40;bool, false&#41;&#10; enable_daemonset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_deployment_metrics &#61; optional&#40;bool, false&#41;&#10; enable_hpa_metrics &#61; optional&#40;bool, false&#41;&#10; enable_pod_metrics &#61; optional&#40;bool, false&#41;&#10; enable_statefulset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_storage_metrics &#61; optional&#40;bool, false&#41;&#10; enable_cadvisor_metrics &#61; optional&#40;bool, false&#41;&#10; enable_managed_prometheus &#61; optional&#40;bool, true&#41;&#10; advanced_datapath_observability &#61; optional&#40;object&#40;&#123;&#10; enable_metrics &#61; bool&#10; enable_relay &#61; bool&#10; &#125;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_config](variables.tf#L412) | Node-level configuration. | <code title="object&#40;&#123;&#10; boot_disk_kms_key &#61; optional&#40;string&#41;&#10; k8s_labels &#61; optional&#40;map&#40;string&#41;&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;&#41;&#10; service_account &#61; optional&#40;string&#41;&#10; tags &#61; optional&#40;list&#40;string&#41;&#41;&#10; workload_metadata_config_mode &#61; optional&#40;string&#41;&#10; kubelet_readonly_port_enabled &#61; optional&#40;bool&#41;&#10; resource_manager_tags &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_locations](variables.tf#L435) | Zones in which the cluster's nodes are located. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [node_pool_auto_config](variables.tf#L442) | Node pool configs that apply to auto-provisioned node pools in autopilot clusters and node auto-provisioning-enabled clusters. | <code title="object&#40;&#123;&#10; cgroup_mode &#61; optional&#40;string&#41;&#10; kubelet_readonly_port_enabled &#61; optional&#40;bool&#41;&#10; network_tags &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; resource_manager_tags &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [release_channel](variables.tf#L464) | Release channel for GKE upgrades. | <code>string</code> | | <code>null</code> |
| [enable_features](variables.tf#L201) | Enable cluster-level features. Certain features allow configuration. | <code title="object&#40;&#123;&#10; beta_apis &#61; optional&#40;list&#40;string&#41;&#41;&#10; binary_authorization &#61; optional&#40;bool, false&#41;&#10; cilium_clusterwide_network_policy &#61; optional&#40;bool, false&#41;&#10; cost_management &#61; optional&#40;bool, true&#41;&#10; dns &#61; optional&#40;object&#40;&#123;&#10; additive_vpc_scope_dns_domain &#61; optional&#40;string&#41;&#10; provider &#61; optional&#40;string&#41;&#10; scope &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; multi_networking &#61; optional&#40;bool, false&#41;&#10; database_encryption &#61; optional&#40;object&#40;&#123;&#10; state &#61; string&#10; key_name &#61; string&#10; &#125;&#41;&#41;&#10; dataplane_v2 &#61; optional&#40;bool, true&#41;&#10; fqdn_network_policy &#61; optional&#40;bool, true&#41;&#10; gateway_api &#61; optional&#40;bool, false&#41;&#10; groups_for_rbac &#61; optional&#40;string&#41;&#10; image_streaming &#61; optional&#40;bool, false&#41;&#10; intranode_visibility &#61; optional&#40;bool, false&#41;&#10; l4_ilb_subsetting &#61; optional&#40;bool, false&#41;&#10; mesh_certificates &#61; optional&#40;bool&#41;&#10; pod_security_policy &#61; optional&#40;bool, false&#41;&#10; rbac_binding_config &#61; optional&#40;object&#40;&#123;&#10; enable_insecure_binding_system_unauthenticated &#61; optional&#40;bool&#41;&#10; enable_insecure_binding_system_authenticated &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; secret_manager_config &#61; optional&#40;bool&#41;&#10; security_posture_config &#61; optional&#40;object&#40;&#123;&#10; mode &#61; string&#10; vulnerability_mode &#61; string&#10; &#125;&#41;&#41;&#10; resource_usage_export &#61; optional&#40;object&#40;&#123;&#10; dataset &#61; string&#10; enable_network_egress_metering &#61; optional&#40;bool&#41;&#10; enable_resource_consumption_metering &#61; optional&#40;bool&#41;&#10; &#125;&#41;&#41;&#10; service_external_ips &#61; optional&#40;bool, true&#41;&#10; shielded_nodes &#61; optional&#40;bool, false&#41;&#10; tpu &#61; optional&#40;bool, false&#41;&#10; upgrade_notifications &#61; optional&#40;object&#40;&#123;&#10; enabled &#61; optional&#40;bool, true&#41;&#10; event_types &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; topic_id &#61; optional&#40;string&#41;&#10; kms_key_name &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; vertical_pod_autoscaling &#61; optional&#40;bool, false&#41;&#10; workload_identity &#61; optional&#40;bool, true&#41;&#10; enterprise_cluster &#61; optional&#40;bool&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [fleet_project](variables.tf#L274) | The name of the fleet host project where this cluster will be registered. | <code>string</code> | | <code>null</code> |
| [issue_client_certificate](variables.tf#L280) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
| [labels](variables.tf#L286) | Cluster resource labels. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [logging_config](variables.tf#L298) | Logging configuration. | <code title="object&#40;&#123;&#10; enable_system_logs &#61; optional&#40;bool, true&#41;&#10; enable_workloads_logs &#61; optional&#40;bool, false&#41;&#10; enable_api_server_logs &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_logs &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_logs &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [maintenance_config](variables.tf#L319) | Maintenance window configuration. | <code title="object&#40;&#123;&#10; daily_window_start_time &#61; optional&#40;string&#41;&#10; recurring_window &#61; optional&#40;object&#40;&#123;&#10; start_time &#61; string&#10; end_time &#61; string&#10; recurrence &#61; string&#10; &#125;&#41;&#41;&#10; maintenance_exclusions &#61; optional&#40;list&#40;object&#40;&#123;&#10; name &#61; string&#10; start_time &#61; string&#10; end_time &#61; string&#10; scope &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; daily_window_start_time &#61; &#34;03:00&#34;&#10; recurring_window &#61; null&#10; maintenance_exclusion &#61; &#91;&#93;&#10;&#125;">&#123;&#8230;&#125;</code> |
| [max_pods_per_node](variables.tf#L342) | Maximum number of pods per node in this cluster. | <code>number</code> | | <code>110</code> |
| [min_master_version](variables.tf#L348) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
| [monitoring_config](variables.tf#L354) | Monitoring configuration. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object&#40;&#123;&#10; enable_system_metrics &#61; optional&#40;bool, true&#41;&#10; enable_api_server_metrics &#61; optional&#40;bool, false&#41;&#10; enable_controller_manager_metrics &#61; optional&#40;bool, false&#41;&#10; enable_scheduler_metrics &#61; optional&#40;bool, false&#41;&#10; enable_daemonset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_deployment_metrics &#61; optional&#40;bool, false&#41;&#10; enable_hpa_metrics &#61; optional&#40;bool, false&#41;&#10; enable_pod_metrics &#61; optional&#40;bool, false&#41;&#10; enable_statefulset_metrics &#61; optional&#40;bool, false&#41;&#10; enable_storage_metrics &#61; optional&#40;bool, false&#41;&#10; enable_cadvisor_metrics &#61; optional&#40;bool, false&#41;&#10; enable_managed_prometheus &#61; optional&#40;bool, true&#41;&#10; advanced_datapath_observability &#61; optional&#40;object&#40;&#123;&#10; enable_metrics &#61; bool&#10; enable_relay &#61; bool&#10; &#125;&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_config](variables.tf#L413) | Node-level configuration. | <code title="object&#40;&#123;&#10; boot_disk_kms_key &#61; optional&#40;string&#41;&#10; k8s_labels &#61; optional&#40;map&#40;string&#41;&#41;&#10; labels &#61; optional&#40;map&#40;string&#41;&#41;&#10; service_account &#61; optional&#40;string&#41;&#10; tags &#61; optional&#40;list&#40;string&#41;&#41;&#10; workload_metadata_config_mode &#61; optional&#40;string&#41;&#10; kubelet_readonly_port_enabled &#61; optional&#40;bool&#41;&#10; resource_manager_tags &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [node_locations](variables.tf#L436) | Zones in which the cluster's nodes are located. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [node_pool_auto_config](variables.tf#L443) | Node pool configs that apply to auto-provisioned node pools in autopilot clusters and node auto-provisioning-enabled clusters. | <code title="object&#40;&#123;&#10; cgroup_mode &#61; optional&#40;string&#41;&#10; kubelet_readonly_port_enabled &#61; optional&#40;bool&#41;&#10; network_tags &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; resource_manager_tags &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [release_channel](variables.tf#L465) | Release channel for GKE upgrades. | <code>string</code> | | <code>null</code> |
## Outputs

View File

@@ -689,4 +689,5 @@ resource "google_pubsub_topic" "notifications" {
labels = {
content = "gke-notifications"
}
kms_key_name = try(var.enable_features.upgrade_notifications.kms_key_name, null)
}

View File

@@ -243,9 +243,10 @@ variable "enable_features" {
shielded_nodes = optional(bool, false)
tpu = optional(bool, false)
upgrade_notifications = optional(object({
enabled = optional(bool, true)
event_types = optional(list(string), [])
topic_id = optional(string)
enabled = optional(bool, true)
event_types = optional(list(string), [])
topic_id = optional(string)
kms_key_name = optional(string)
}))
vertical_pod_autoscaling = optional(bool, false)
workload_identity = optional(bool, true)

View File

@@ -118,17 +118,17 @@ module "bucket" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [name](variables.tf#L60) | Name of the logging bucket. | <code>string</code> | ✓ | |
| [parent](variables.tf#L65) | ID of the parent resource containing the bucket in the format 'project_id' 'folders/folder_id', 'organizations/organization_id' or 'billing_account_id'. | <code>string</code> | ✓ | |
| [context](variables.tf#L17) | Context-specific interpolations. | <code title="object&#40;&#123;&#10; custom_roles &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; folder_ids &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; iam_principals &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; locations &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; project_ids &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; tag_values &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [description](variables.tf#L31) | Human-readable description for the logging bucket. | <code>string</code> | | <code>null</code> |
| [kms_key_name](variables.tf#L37) | To enable CMEK for a project logging bucket, set this field to a valid name. The associated service account requires cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. | <code>string</code> | | <code>null</code> |
| [location](variables.tf#L43) | Location of the bucket. | <code>string</code> | | <code>&#34;global&#34;</code> |
| [log_analytics](variables.tf#L49) | Enable and configure Analytics Log. | <code title="object&#40;&#123;&#10; enable &#61; optional&#40;bool, false&#41;&#10; dataset_link_id &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Log Analytics Dataset&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [parent_type](variables.tf#L73) | Parent object type for the bucket (project, folder, organization, billing_account). | <code>string</code> | | <code>&#34;project&#34;</code> |
| [retention](variables.tf#L80) | Retention time in days for the logging bucket. | <code>number</code> | | <code>30</code> |
| [tag_bindings](variables.tf#L86) | Tag bindings for this bucket, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [views](variables.tf#L93) | Log views for this bucket. | <code title="map&#40;object&#40;&#123;&#10; filter &#61; string&#10; location &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string&#41;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [name](variables.tf#L61) | Name of the logging bucket. | <code>string</code> | ✓ | |
| [parent](variables.tf#L66) | ID of the parent resource containing the bucket in the format 'project_id' 'folders/folder_id', 'organizations/organization_id' or 'billing_account_id'. | <code>string</code> | ✓ | |
| [context](variables.tf#L17) | Context-specific interpolations. | <code title="object&#40;&#123;&#10; custom_roles &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; folder_ids &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; iam_principals &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; kms_keys &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; locations &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; project_ids &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10; tag_values &#61; optional&#40;map&#40;string&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [description](variables.tf#L32) | Human-readable description for the logging bucket. | <code>string</code> | | <code>null</code> |
| [kms_key_name](variables.tf#L38) | To enable CMEK for a project logging bucket, set this field to a valid name. The associated service account requires cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key. | <code>string</code> | | <code>null</code> |
| [location](variables.tf#L44) | Location of the bucket. | <code>string</code> | | <code>&#34;global&#34;</code> |
| [log_analytics](variables.tf#L50) | Enable and configure Analytics Log. | <code title="object&#40;&#123;&#10; enable &#61; optional&#40;bool, false&#41;&#10; dataset_link_id &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string, &#34;Log Analytics Dataset&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [parent_type](variables.tf#L74) | Parent object type for the bucket (project, folder, organization, billing_account). | <code>string</code> | | <code>&#34;project&#34;</code> |
| [retention](variables.tf#L81) | Retention time in days for the logging bucket. | <code>number</code> | | <code>30</code> |
| [tag_bindings](variables.tf#L87) | Tag bindings for this bucket, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [views](variables.tf#L94) | Log views for this bucket. | <code title="map&#40;object&#40;&#123;&#10; filter &#61; string&#10; location &#61; optional&#40;string&#41;&#10; description &#61; optional&#40;string&#41;&#10; iam &#61; optional&#40;map&#40;list&#40;string&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings &#61; optional&#40;map&#40;object&#40;&#123;&#10; members &#61; list&#40;string&#41;&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10; iam_bindings_additive &#61; optional&#40;map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
## Outputs

View File

@@ -42,6 +42,7 @@ locals {
}
}
resource "google_logging_project_bucket_config" "bucket" {
count = var.parent_type == "project" ? 1 : 0
project = local.parent_id
@@ -53,7 +54,7 @@ resource "google_logging_project_bucket_config" "bucket" {
dynamic "cmek_settings" {
for_each = var.kms_key_name == null ? [] : [""]
content {
kms_key_name = var.kms_key_name
kms_key_name = lookup(local.ctx.kms_keys, var.kms_key_name, var.kms_key_name)
}
}
}

View File

@@ -20,6 +20,7 @@ variable "context" {
custom_roles = optional(map(string), {})
folder_ids = optional(map(string), {})
iam_principals = optional(map(string), {})
kms_keys = optional(map(string), {})
locations = optional(map(string), {})
project_ids = optional(map(string), {})
tag_values = optional(map(string), {})

File diff suppressed because one or more lines are too long

View File

@@ -18,11 +18,12 @@ locals {
projects_bigquery_datasets = flatten([
for k, v in local.projects_input : [
for name, opts in lookup(v, "datasets", {}) : {
project_key = k
project_name = v.name
id = name
friendly_name = lookup(opts, "friendly_name", null)
location = lookup(opts, "location", null)
project_key = k
project_name = v.name
id = name
encryption_key = lookup(opts, "encryption_key", null)
friendly_name = lookup(opts, "friendly_name", null)
location = lookup(opts, "location", null)
}
]
])
@@ -33,7 +34,7 @@ module "bigquery-datasets" {
for_each = {
for k in local.projects_bigquery_datasets : "${k.project_key}/${k.id}" => k
}
project_id = module.projects[each.value.project_key].project_id
project_id = module.projects-iam[each.value.project_key].project_id
id = each.value.id
context = merge(local.ctx, {
iam_principals = merge(
@@ -46,7 +47,8 @@ module "bigquery-datasets" {
locations = local.ctx.locations
project_ids = local.ctx_project_ids
})
friendly_name = each.value.friendly_name
encryption_key = each.value.encryption_key
friendly_name = each.value.friendly_name
location = coalesce(
local.data_defaults.overrides.locations.bigquery,
lookup(each.value, "location", null),

View File

@@ -62,7 +62,7 @@ module "buckets" {
for_each = {
for k in local.projects_buckets : "${k.project_key}/${k.name}" => k
}
project_id = module.projects[each.value.project_key].project_id
project_id = module.projects-iam[each.value.project_key].project_id
prefix = each.value.prefix
name = "${each.value.project_name}-${each.value.name}"
bucket_create = each.value.create

View File

@@ -154,8 +154,9 @@ variable "projects" {
})), {})
contacts = optional(map(list(string)), {})
datasets = optional(map(object({
friendly_name = optional(string)
location = optional(string)
encryption_key = optional(string)
friendly_name = optional(string)
location = optional(string)
})), {})
iam = optional(map(list(string)), {})
iam_bindings = optional(map(object({

View File

@@ -31,7 +31,7 @@ locals {
# https://cloud.google.com/composer/docs/composer-3/configure-cmek-encryption#grant-roles-permissions
"composer.googleapis.com" : ["composer", "storage"]
"compute.googleapis.com" : ["compute"]
"container.googleapis.com" : ["compute"]
"container.googleapis.com" : ["compute", "container-engine-robot"]
"dataflow.googleapis.com" : ["dataflow", "compute"]
"dataform.googleapis.com" : ["dataform"]
"datafusion.googleapis.com" : [
@@ -42,12 +42,13 @@ locals {
"datastream.googleapis.com" : ["datastream"]
"dialogflow.googleapis.com" : ["dialogflow-cmek"]
"file.googleapis.com" : ["cloud-filer"]
"logging.googleapis.com" : ["logging"]
"pubsub.googleapis.com" : ["pubsub"]
"run.googleapis.com" : ["cloudrun"]
"secretmanager.googleapis.com" : ["secretmanager"]
"spanner.googleapis.com" : ["spanner"]
"sqladmin.googleapis.com" : ["cloud-sql"]
"storage.googleapis.com" : ["storage"]
"run.googleapis.com" : ["cloudrun"]
}
_all_cmek_bindings = flatten([
for service, keys in var.service_encryption_key_ids : [

View File

@@ -11,6 +11,9 @@ context = {
myuser = "user:test-user@example.com"
myuser2 = "user:test-user2@example.com"
}
kms_keys = {
mykey = "projects/366118655033/locations/europe-west8/keyRings/mykeyring/cryptoKeys/mykey"
}
locations = {
ew8 = "europe-west8"
}
@@ -21,9 +24,10 @@ context = {
"test/one" = "tagValues/1234567890"
}
}
project_id = "$project_ids:test"
id = "dataset_0"
location = "$locations:ew8"
project_id = "$project_ids:test"
id = "dataset_0"
location = "$locations:ew8"
encryption_key = "$kms_keys:mykey"
iam = {
"$custom_roles:myrole_one" = [
"$iam_principals:myuser"

View File

@@ -15,7 +15,8 @@
values:
google_bigquery_dataset.default:
dataset_id: dataset_0
default_encryption_configuration: []
default_encryption_configuration:
- kms_key_name: projects/366118655033/locations/europe-west8/keyRings/mykeyring/cryptoKeys/mykey
default_partition_expiration_ms: null
default_table_expiration_ms: null
delete_contents_on_destroy: false

View File

@@ -0,0 +1,48 @@
# Copyright 2023 Google LLC
#
# 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.
values:
module.cluster-1.google_container_cluster.cluster:
notification_config:
- pubsub:
- enabled: true
filter:
- event_type:
- SECURITY_BULLETIN_EVENT
- UPGRADE_EVENT
module.cluster-1.google_pubsub_topic.notifications[0]:
effective_labels:
content: gke-notifications
goog-terraform-provisioned: 'true'
ingestion_data_source_settings: []
kms_key_name: projects/myproject/locations/global/keyRings/mykeyring/cryptoKeys/mykey
labels:
content: gke-notifications
message_retention_duration: null
message_transforms: []
name: gke-pubsub-notifications
project: project-id
schema_settings: []
tags: null
terraform_labels:
content: gke-notifications
goog-terraform-provisioned: 'true'
timeouts: null
counts:
google_container_cluster: 1
google_pubsub_topic: 1
modules: 1
resources: 2

View File

@@ -160,7 +160,7 @@ values:
content: gke-notifications
goog-terraform-provisioned: 'true'
ingestion_data_source_settings: []
kms_key_name: null
kms_key_name: projects/myproject/locations/global/keyRings/mykeyring/cryptoKeys/mykey
labels:
content: gke-notifications
message_retention_duration: null

View File

@@ -11,6 +11,9 @@ context = {
myuser = "user:test-user@example.com"
myuser2 = "user:test-user2@example.com"
}
kms_keys = {
mykey = "projects/366118655033/locations/europe-west8/keyRings/mykeyring/cryptoKeys/mykey"
}
locations = {
ew8 = "europe-west8"
}
@@ -21,9 +24,10 @@ context = {
"test/one" = "tagValues/1234567890"
}
}
name = "mybucket"
location = "$locations:ew8"
parent = "$project_ids:myproject"
kms_key_name = "$kms_keys:mykey"
name = "mybucket"
location = "$locations:ew8"
parent = "$project_ids:myproject"
tag_bindings = {
foo = "$tag_values:test/one"
}

View File

@@ -35,7 +35,8 @@ values:
role: roles/viewer
google_logging_project_bucket_config.bucket[0]:
bucket_id: mybucket
cmek_settings: []
cmek_settings:
- kms_key_name: projects/366118655033/locations/europe-west8/keyRings/mykeyring/cryptoKeys/mykey
enable_analytics: false
index_configs: []
location: europe-west8