You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| <aname="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation)| Set these options to add a trusted identity provider from meshStack to allow workload identity federation for authentication which can be used instead of access keys. Supports multiple subjects for migration paths and wildcard patterns (e.g., 'system:serviceaccount:namespace:*'). | <pre>object({<br> issuer = string,<br> audience = string,<br> subjects = list(string)<br> })</pre> |`null`| no |
68
+
| <aname="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation)| Set these options to add a trusted identity provider from meshStack to allow workload identity federation for authentication which can be used instead of access keys. Supports multiple subjects and wildcard patterns (e.g., 'system:serviceaccount:namespace:*'). | <pre>object({<br> issuer = string,<br> audience = string,<br> subjects = list(string)<br> })</pre> |`null`| no |
description="Set these options to add a trusted identity provider from meshStack to allow workload identity federation for authentication which can be used instead of access keys. Supports multiple subjects for migration paths and wildcard patterns (e.g., 'system:serviceaccount:namespace:*')."
8
+
description="Set these options to add a trusted identity provider from meshStack to allow workload identity federation for authentication which can be used instead of access keys. Supports multiple subjects and wildcard patterns (e.g., 'system:serviceaccount:namespace:*')."
| <aname="input_existing_principal_ids"></a> [existing\_principal\_ids](#input\_existing\_principal\_ids)| set of existing principal ids that will be granted permissions to deploy the building block |`set(string)`|`[]`| no |
118
136
| <aname="input_name"></a> [name](#input\_name)| name of the building block, used for naming resources |`string`| n/a | yes |
119
137
| <aname="input_scope"></a> [scope](#input\_scope)| Scope where the building block should be deployable, typically the parent of all Landing Zones. |`string`| n/a | yes |
120
-
| <aname="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation)| Configuration for workload identity federation. If not provided, an application password will be created instead. | <pre>object({<br> issuer = string<br> subject = string<br> })</pre> |`null`| no |
138
+
| <aname="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation)| Configuration for workload identity federation. If not provided, an application password will be created instead. Supports multiple subjects. | <pre>object({<br> issuer = string<br> subjects = list(string)<br> })</pre> |`null`| no |
121
139
122
140
## Outputs
123
141
@@ -132,5 +150,5 @@ No modules.
132
150
| <aname="output_role_definition_id"></a> [role\_definition\_id](#output\_role\_definition\_id)| The ID of the role definition that enables deployment of the building block to subscriptions. |
133
151
| <aname="output_role_definition_name"></a> [role\_definition\_name](#output\_role\_definition\_name)| The name of the role definition that enables deployment of the building block to subscriptions. |
134
152
| <aname="output_scope"></a> [scope](#output\_scope)| The scope where the role definition and role assignments are applied. |
135
-
| <aname="output_workload_identity_federation"></a> [workload\_identity\_federation](#output\_workload\_identity\_federation)| Information about the created workload identity federation credential. |
153
+
| <aname="output_workload_identity_federation"></a> [workload\_identity\_federation](#output\_workload\_identity\_federation)| Information about the created workload identity federation credentials. |
description="Configuration for workload identity federation. If not provided, an application password will be created instead."
40
+
description="Configuration for workload identity federation. If not provided, an application password will be created instead. Supports multiple subjects."
} # Optional, if not provided, a service account key will be created instead
20
23
}
21
24
```
22
25
26
+
## Workload Identity Federation
27
+
28
+
When `workload_identity_federation` is configured, the module grants access to the entire workload identity pool at the IAM level, then uses attribute conditions at the provider level to restrict which identities can actually authenticate.
29
+
30
+
### Subject Matching
31
+
32
+
The module supports both exact matching and partial matching for subjects:
33
+
34
+
**Exact matching** - Grant access to specific subjects:
**Partial matching** - Use `startsWith()` to match multiple subjects with a common prefix. Note: The module doesn't use special syntax for this; instead, pass the prefix pattern as-is and it will be matched using CEL's `startsWith()` function:
46
+
47
+
```hcl
48
+
workload_identity_federation = {
49
+
issuer = "https://your-oidc-issuer"
50
+
subjects = [
51
+
"system:serviceaccount:namespace1:", # Matches all service accounts in namespace1
52
+
]
53
+
}
54
+
```
55
+
56
+
This configuration will accept any subject that starts with `system:serviceaccount:namespace1:`, allowing all service accounts in that namespace to authenticate without listing each one individually.
57
+
58
+
**How it works:**
59
+
- IAM binding grants access to the entire workload identity pool (`principalSet://iam.googleapis.com/.../pools/POOL_ID/*`)
60
+
- Attribute conditions in the provider filter which tokens are accepted based on the `google.subject` claim
61
+
- Subjects are evaluated as exact matches first, then partial matches via `startsWith()` checking
| <aname="input_project_id"></a> [project\_id](#input\_project\_id)| The GCP project ID |`string`| n/a | yes |
51
91
| <aname="input_service_account_id"></a> [service\_account\_id](#input\_service\_account\_id)| The ID of the service account to create |`string`|`"buildingblock-storage-sa"`| no |
52
-
| <aname="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation)| Configuration for workload identity federation| <pre>object({<br> workload_identity_pool_identifier = string // Identifier for the workload identity pool<br> audience = string // Audience for the OIDC tokens<br> issuer = string // OIDC issuer URL<br> subject = string // Subject for workload identity federation (e.g., system:serviceaccount:namespace:service-account-name)<br> subject_token_file_path = string // Path to the file containing the OIDC token<br> })</pre> |`null`| no |
92
+
| <aname="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation)| Configuration for workload identity federation. Supports multiple subjects with exact matching and partial matching using startsWith(). | <pre>object({<br> workload_identity_pool_identifier = string // Identifier for the workload identity pool<br> audience = string // Audience for the OIDC tokens<br> issuer = string // OIDC issuer URL<br> subjects= list(string) // Subjects for workload identity federation - can use exact matches or startsWith patterns<br> subject_token_file_path = string // Path to the file containing the OIDC token<br> })</pre> |`null`| no |
0 commit comments