File tree Expand file tree Collapse file tree 5 files changed +29
-0
lines changed
modules/create_environment Expand file tree Collapse file tree 5 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module "composer" {
3535| enable\_ private\_ endpoint | Configure public access to the cluster endpoint. | ` bool ` | ` false ` | no |
3636| env\_ variables | Variables of the airflow environment. | ` map(string) ` | ` {} ` | no |
3737| image\_ version | The version of the aiflow running in the cloud composer environment. | ` string ` | ` null ` | no |
38+ | kms\_ key\_ name | Customer-managed Encryption Key fully qualified resource name, i.e. projects/project-id/locations/location/keyRings/keyring/cryptoKeys/key. | ` string ` | ` null ` | no |
3839| labels | The resource labels (a map of key/value pairs) to be applied to the Cloud Composer. | ` map(string) ` | ` {} ` | no |
3940| machine\_ type | Machine type of Cloud Composer nodes. | ` string ` | ` "n1-standard-8" ` | no |
4041| master\_ ipv4\_ cidr | The CIDR block from which IP range in tenant project will be reserved for the master. | ` string ` | ` null ` | no |
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ locals {
2020}
2121
2222resource "google_composer_environment" "composer_env" {
23+ provider = google- beta
24+
2325 project = var. project_id
2426 name = var. composer_env_name
2527 region = var. region
@@ -81,5 +83,15 @@ resource "google_composer_environment" "composer_env" {
8183 python_version = software_config. value [" python_version" ]
8284 }
8385 }
86+
87+ dynamic "encryption_config" {
88+ for_each = var. kms_key_name != null ? [
89+ {
90+ kms_key_name = var.kms_key_name
91+ }] : []
92+ content {
93+ kms_key_name = encryption_config. value [" kms_key_name" ]
94+ }
95+ }
8496 }
8597}
Original file line number Diff line number Diff line change @@ -171,3 +171,9 @@ variable "enable_private_endpoint" {
171171 type = bool
172172 default = false
173173}
174+
175+ variable "kms_key_name" {
176+ description = " Customer-managed Encryption Key fully qualified resource name, i.e. projects/project-id/locations/location/keyRings/keyring/cryptoKeys/key."
177+ type = string
178+ default = null
179+ }
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ terraform {
2222 source = " hashicorp/google"
2323 version = " ~> 3.53"
2424 }
25+
26+ google-beta = {
27+ source = " hashicorp/google-beta"
28+ version = " ~> 3.53"
29+ }
2530 }
2631
2732 provider_meta "google" {
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ terraform {
2222 source = " hashicorp/google"
2323 version = " ~> 3.53"
2424 }
25+
26+ google-beta = {
27+ source = " hashicorp/google-beta"
28+ version = " ~> 3.53"
29+ }
2530 }
2631
2732 provider_meta "google" {
You can’t perform that action at this time.
0 commit comments