Skip to content

Commit

Permalink
Merge branch 'master' into enable-multiple-display-name
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Aug 5, 2024
2 parents af33427 + 4e586a7 commit 62bb06c
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ docker_test_lint:
.PHONY: docker_generate_docs
docker_generate_docs:
docker run --rm -it \
-e ENABLE_BPMETADATA \
-v "$(CURDIR)":/workspace \
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs'
Expand Down
2 changes: 2 additions & 0 deletions examples/simple_sa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This example shows how to use the `simple-sa` submodule.
| Name | Description |
|------|-------------|
| email | Service account email |
| env\_vars | Exported environment variables |
| iam\_email | IAM format service account email |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
10 changes: 10 additions & 0 deletions examples/simple_sa/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ output "email" {
description = "Service account email"
value = module.sa.email
}

output "iam_email" {
description = "IAM format service account email"
value = module.sa.iam_email
}

output "env_vars" {
description = "Exported environment variables"
value = module.sa.env_vars
}
4 changes: 3 additions & 1 deletion modules/simple-sa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ module "sa" {
| Name | Description |
|------|-------------|
| email | Service account email |
| id | Service account id and email |
| env\_vars | Exported environment variables |
| iam\_email | IAM format service account email |
| id | Service account id in the format 'projects/{{project}}/serviceAccounts/{{email}}' |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 4 additions & 0 deletions modules/simple-sa/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
outputs:
- name: email
description: Service account email
- name: env_vars
description: Exported environment variables
- name: iam_email
description: IAM format service account email
- name: id
description: Service account id and email
requirements:
Expand Down
18 changes: 13 additions & 5 deletions modules/simple-sa/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ output "email" {
value = google_service_account.sa.email
}

output "iam_email" {
description = "IAM format service account email"
value = google_service_account.sa.member
}

output "id" {
description = "Service account id and email"
value = {
id = google_service_account.sa.account_id,
email = google_service_account.sa.email
}
description = "Service account id in the format 'projects/{{project}}/serviceAccounts/{{email}}'"
value = google_service_account.sa.account_id
}

output "env_vars" {
description = "Exported environment variables"
value = { "SERVICE_ACCOUNT_EMAIL" : google_service_account.sa.email,
"SERVICE_ACCOUNT_IAM_EMAIL" : google_service_account.sa.member }
}
6 changes: 6 additions & 0 deletions test/integration/simple_sa/simple_sa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func TestSimpleSA(t *testing.T) {
for _, b := range bindings {
assert.Contains(expectedRoles, b.Get("bindings.role").String())
}

iam_email := sa.GetStringOutput("iam_email")
env_vars := sa.GetStringOutput("env_vars")
assert.Contains(iam_email, "serviceAccount:")
assert.Contains(env_vars, "SERVICE_ACCOUNT_EMAIL")
assert.Contains(env_vars, "SERVICE_ACCOUNT_IAM_EMAIL")
})
sa.Test()
}

0 comments on commit 62bb06c

Please sign in to comment.