fix(stages): only add sandbox SA when `sandbox` feature is enabled (#1391)
If you have the `project_factory` feature enabled, but not the `sandbox` feature (as it's not a requirement on your org), when doing a `terraform apply` on `1-resman` it raises this errors as it's expecting the wrong feature when creating the sandbox SA ``` │ Error: Invalid index │ │ on branch-sandbox.tf line 68, in resource "google_organization_iam_member" "org_policy_admin_sandbox": │ 68: member = module.branch-sandbox-sa.0.iam_email │ ├──────────────── │ │ module.branch-sandbox-sa is empty tuple │ │ The given key does not identify an element in this collection value: the collection has no elements. ```
This commit is contained in:
parent
d245088fa1
commit
00cac9148a
|
@ -62,7 +62,7 @@ module "branch-sandbox-sa" {
|
|||
}
|
||||
|
||||
resource "google_organization_iam_member" "org_policy_admin_sandbox" {
|
||||
count = var.fast_features.project_factory ? 1 : 0
|
||||
count = var.fast_features.sandbox ? 1 : 0
|
||||
org_id = var.organization.id
|
||||
role = "roles/orgpolicy.policyAdmin"
|
||||
member = module.branch-sandbox-sa.0.iam_email
|
||||
|
|
Loading…
Reference in New Issue