Skip to content

Commit 637aca8

Browse files
committed
Add new output account_details, output type and metadata.display.yaml
1 parent 809f359 commit 637aca8

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
lines changed

modules/simple-sa/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module "sa" {
3535

3636
| Name | Description |
3737
|------|-------------|
38+
| account\_details | Service account id and email |
3839
| email | Service account email |
3940
| env\_vars | Exported environment variables |
4041
| iam\_email | IAM format service account email |
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintMetadata
17+
metadata:
18+
name: terraform-google-service-accounts-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: Terraform Simple Service Account module
24+
source:
25+
repo: https://github.com/q2w/terraform-google-service-accounts.git
26+
sourceType: git
27+
dir: /modules/simple-sa
28+
ui:
29+
input:
30+
variables:
31+
description:
32+
name: description
33+
title: Description
34+
display_name:
35+
name: display_name
36+
title: Display Name
37+
name:
38+
name: name
39+
title: Name
40+
project_id:
41+
name: project_id
42+
title: Project Id
43+
project_roles:
44+
name: project_roles
45+
title: Project Roles

modules/simple-sa/metadata.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,27 @@ spec:
6363
varType: list(string)
6464
required: true
6565
outputs:
66+
- name: account_details
67+
description: Service account id and email
68+
type:
69+
- object
70+
- email: string
71+
id: string
6672
- name: email
6773
description: Service account email
74+
type: string
6875
- name: env_vars
6976
description: Exported environment variables
77+
type:
78+
- object
79+
- SERVICE_ACCOUNT_EMAIL: string
80+
SERVICE_ACCOUNT_IAM_EMAIL: string
7081
- name: iam_email
7182
description: IAM format service account email
83+
type: string
7284
- name: id
73-
description: Service account id and email
85+
description: Service account id in the format 'projects/{{project}}/serviceAccounts/{{email}}'
86+
type: string
7487
requirements:
7588
roles:
7689
- level: Project

modules/simple-sa/outputs.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ output "id" {
2929
value = google_service_account.sa.id
3030
}
3131

32+
output "account_details" {
33+
description = "Service account id and email"
34+
value = {
35+
"id" : google_service_account.sa.account_id,
36+
"email" : google_service_account.sa.email
37+
}
38+
}
39+
3240
output "env_vars" {
3341
description = "Exported environment variables"
3442
value = { "SERVICE_ACCOUNT_EMAIL" : google_service_account.sa.email,

0 commit comments

Comments
 (0)