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
Copy file name to clipboardExpand all lines: README.md
+42-24Lines changed: 42 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,14 @@
1
-
# terraform-google-service-accounts
1
+
# Terraform Service Accounts Module
2
2
3
-
This module was generated from [terraform-google-module-template](https://github.com/terraform-google-modules/terraform-google-module-template/), which by default generates a module that simply creates a GCS bucket. As the module develops, this README should be updated.
3
+
This module allows easy creation of one or more service accounts, and granting them basic roles.
4
4
5
5
The resources/services/activations/deletions that this module will create/trigger are:
6
6
7
-
- Create a GCS bucket with the provided name
7
+
- one or more service accounts
8
+
- optional project-level IAM role bindings for each service account
9
+
- one optional billing IAM role binding per service account, at the organization or billing account level
10
+
- two optional organization-level IAM bindings per service account, to enable the service accounts to create and manage Shared VPC networks
11
+
- one optional service account key per service account
8
12
9
13
## Usage
10
14
@@ -14,9 +18,13 @@ Basic usage of this module is as follows:
@@ -25,6 +33,30 @@ Functional examples are included in the
25
33
26
34
[^]: (autogen_docs_start)
27
35
36
+
## Inputs
37
+
38
+
| Name | Description | Type | Default | Required |
39
+
|------|-------------|:----:|:-----:|:-----:|
40
+
| billing\_account\_id | If assigning billing role, specificy a billing account (default is to assign at the organizational level). | string |`""`| no |
41
+
| generate\_keys | Generate keys for service accounts. | string |`"false"`| no |
42
+
| grant\_billing\_role | Grant billing user role. | string |`"false"`| no |
43
+
| grant\_xpn\_roles | Grant roles for shared VPC management. | string |`"true"`| no |
44
+
| names | Names of the service accounts to create. | list |`<list>`| no |
45
+
| org\_id | Id of the organization for org-level roles. | string |`""`| no |
46
+
| prefix | Prefix applied to service account names. | string |`""`| no |
47
+
| project\_id | Project id where service account will be created. | string | n/a | yes |
48
+
| project\_roles | Common roles to apply to all service accounts, project=>role as elements. | list |`<list>`| no |
49
+
50
+
## Outputs
51
+
52
+
| Name | Description |
53
+
|------|-------------|
54
+
| email | Service account email (single-use case). |
55
+
| emails | Map of service account emails. |
56
+
| iam\_email | IAM-format service account email (single-use case). |
57
+
| iam\_emails | IAM-format service account emails. |
58
+
| keys | Map of service account keys. |
59
+
28
60
[^]: (autogen_docs_end)
29
61
30
62
## Requirements
@@ -36,28 +68,14 @@ These sections describe requirements for using this module.
36
68
The following dependencies must be available:
37
69
38
70
-[Terraform][terraform] v0.11
39
-
-[Terraform Provider for GCP][terraform-provider-gcp] plugin v2.0
40
-
41
-
### Service Account
42
-
43
-
A service account with the following roles must be used to provision
44
-
the resources of this module:
45
-
46
-
- Storage Admin: `roles/storage.admin`
47
-
48
-
The [Project Factory module][project-factory-module] and the
49
-
[IAM module][iam-module] may be used in combination to provision a
50
-
service account with the necessary roles applied.
51
-
52
-
### APIs
71
+
-[Terraform Provider for GCP][terraform-provider-gcp] plugin >= v2.0
53
72
54
-
A project with the following APIs enabled must be used to host the
55
-
resources of this module:
73
+
### IAM
56
74
57
-
- Google Cloud Storage JSON API: `storage-api.googleapis.com`
75
+
Service account or user credentials with the following roles must be used to provision the resources of this module:
58
76
59
-
The [Project Factory module][project-factory-module] can be used to
60
-
provision a project with the necessary APIs enabled.
77
+
- Service Account Admin: `roles/iam.serviceAccountAdmin`
78
+
- roles needed to grant optional IAM roles at the project or organizational level
0 commit comments