Skip to content

Commit 330e280

Browse files
Adding support for propller pods via workload identity (#21)
* Adding support for propller pods via workload identity * terraform-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b41c24e commit 330e280

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Truefoundry Google Cloud platform features module
3939
| [google_project_iam_member.truefoundry_platform_feature_secret_manager_role_binding](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_member) | resource |
4040
| [google_project_iam_member.truefoundry_platform_feature_token_creator_role_binding](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_member) | resource |
4141
| [google_service_account.truefoundry_platform_feature_service_account](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account) | resource |
42+
| [google_service_account_iam_binding.truefoundry_platform_feature_flyte_propeller_service_account_binding](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account_iam_binding) | resource |
4243
| [google_service_account_key.truefoundry_platform_feature_service_account_key](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account_key) | resource |
4344
| [random_string.random_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
4445
| [google_project.truefoundry_platform_feature_project](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/project) | data source |
@@ -58,6 +59,8 @@ Truefoundry Google Cloud platform features module
5859
| <a name="input_feature_docker_registry_enabled"></a> [feature\_docker\_registry\_enabled](#input\_feature\_docker\_registry\_enabled) | Enable docker registry feature in the platform | `bool` | `true` | no |
5960
| <a name="input_feature_logs_viewer_enabled"></a> [feature\_logs\_viewer\_enabled](#input\_feature\_logs\_viewer\_enabled) | Enable logs viewer permission in the platform | `bool` | `true` | no |
6061
| <a name="input_feature_secrets_enabled"></a> [feature\_secrets\_enabled](#input\_feature\_secrets\_enabled) | Enable secrets manager feature in the platform | `bool` | `true` | no |
62+
| <a name="input_flyte_propeller_serviceaccount_name"></a> [flyte\_propeller\_serviceaccount\_name](#input\_flyte\_propeller\_serviceaccount\_name) | Name for the Flyte Propeller service account | `string` | `"flytepropeller"` | no |
63+
| <a name="input_flyte_propeller_serviceaccount_namespace"></a> [flyte\_propeller\_serviceaccount\_namespace](#input\_flyte\_propeller\_serviceaccount\_namespace) | Namespace for the Flyte Propeller service account | `string` | `"tfy-workflow-propeller"` | no |
6164
| <a name="input_project"></a> [project](#input\_project) | GCP Project | `string` | n/a | yes |
6265
| <a name="input_region"></a> [region](#input\_region) | region | `string` | n/a | yes |
6366
| <a name="input_service_account_additional_roles"></a> [service\_account\_additional\_roles](#input\_service\_account\_additional\_roles) | List of additional IAM roles to be added to the service account | `list(string)` | `[]` | no |

iam.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ resource "google_project_iam_member" "truefoundry_platform_feature_additional_ro
182182
member = "serviceAccount:${local.serviceaccount_email}"
183183
}
184184

185+
resource "google_service_account_iam_binding" "truefoundry_platform_feature_flyte_propeller_service_account_binding" {
186+
count = var.service_account_enabled ? 1 : 0
187+
service_account_id = google_service_account.truefoundry_platform_feature_service_account[0].id
188+
role = "roles/iam.workloadIdentityUser"
189+
190+
members = [
191+
"serviceAccount:${var.project}.svc.id.goog[${var.flyte_propeller_serviceaccount_namespace}/${var.flyte_propeller_serviceaccount_name}]",
192+
]
193+
}
194+
185195
// service account key
186196
resource "google_service_account_key" "truefoundry_platform_feature_service_account_key" {
187197
count = var.service_account_enabled && var.service_account_key_creation_enabled ? 1 : 0

variables.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ variable "service_account_additional_roles" {
6969
default = []
7070
}
7171

72+
################################################################################
73+
## Flyte Propeller
74+
################################################################################
75+
variable "flyte_propeller_serviceaccount_namespace" {
76+
description = "Namespace for the Flyte Propeller service account"
77+
type = string
78+
default = "tfy-workflow-propeller"
79+
}
80+
81+
variable "flyte_propeller_serviceaccount_name" {
82+
description = "Name for the Flyte Propeller service account"
83+
type = string
84+
default = "flytepropeller"
85+
}
86+
7287
################################################################################
7388
# Blob Storage
7489
################################################################################

0 commit comments

Comments
 (0)