Skip to content

Commit 39d303f

Browse files
feat: customize composer sa name in sub-module composer_net
1 parent f81c44c commit 39d303f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

modules/composer_net/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This example illustrates how to use the `composer-net` module. Please see exampl
99
|------|-------------|------|---------|:--------:|
1010
| cloud\_composer\_network\_ipv4\_cidr\_block | The CIDR block from which IP range in tenant project will be reserved. | `string` | `null` | no |
1111
| composer\_env\_name | Name of Cloud Composer Environment | `string` | n/a | yes |
12+
| composer\_sa\_name | Service Account name to be used for running Cloud Composer Environment. | `string` | `"composer-sa"` | no |
1213
| dns\_zone\_name | Composer DNS private zone name | `string` | `"composer-google-cloud-dns"` | no |
1314
| gke\_pods\_services\_ip\_ranges | The secondary IP ranges for the GKE Pods and Services IP ranges | `list(string)` | n/a | yes |
1415
| gke\_subnet\_ip\_range | The GKE subnet IP range | `list(string)` | n/a | yes |

modules/composer_net/iam.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Assign the Composer Worker (composer.worker) role.
3838
Assign the Service Account User (iam.serviceAccountUser) role
3939
***/
4040
resource "google_service_account" "composer_sa" {
41-
account_id = "composer-sa"
42-
display_name = "composer-sa"
41+
account_id = var.composer_sa_name
42+
display_name = var.composer_sa_name
4343
project = var.service_project_id
4444
}
4545

modules/composer_net/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,9 @@ variable "dns_zone_name" {
7777
type = string
7878
default = "composer-google-cloud-dns"
7979
}
80+
81+
variable "composer_sa_name" {
82+
description = "Service Account name to be used for running Cloud Composer Environment."
83+
type = string
84+
default = "composer-sa"
85+
}

0 commit comments

Comments
 (0)