|
1 | 1 | # terraform-google-service-account
|
2 |
| -Terraform module : GCP : for creation service account. |
| 2 | + |
| 3 | +Terraform module to provision service account with normalized name. |
3 | 4 |
|
4 | 5 | ## Usage
|
5 | 6 |
|
6 | 7 | ```terraform
|
7 |
| -module "s3_service_account" { |
8 |
| - source = "git::https://github.com/SweetOps/terraform-google-service-account.git?ref=master" |
| 8 | +module "service_account" { |
| 9 | + source = "git::https://github.com/SweetOps/terraform-google-service-account.git?ref=master" |
9 | 10 | name = "awesome"
|
10 | 11 | stage = "production"
|
11 | 12 | namespace = "sweetops"
|
12 | 13 | }
|
13 | 14 | ```
|
14 | 15 |
|
| 16 | +<!--- BEGIN_TF_DOCS ---> |
| 17 | +## Requirements |
| 18 | + |
| 19 | +| Name | Version | |
| 20 | +|------|---------| |
| 21 | +| terraform | >= 0.13 | |
| 22 | +| google | >= 3.0 | |
| 23 | + |
| 24 | +## Providers |
| 25 | + |
| 26 | +| Name | Version | |
| 27 | +|------|---------| |
| 28 | +| google | >= 3.0 | |
15 | 29 |
|
16 | 30 | ## Inputs
|
17 | 31 |
|
18 |
| -| Name | Description | Type | Default | Required | |
19 |
| -|:------------|:------------------------------------------------------------------------------------------------|:------:|:--------:|:--------:| |
20 |
| -| name | Solution name, e.g. 'app' or 'jenkins' | string | n/a | yes | |
21 |
| -| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | n/a | yes | |
22 |
| -| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | n/a | yes | |
23 |
| -| attributes | Additional attributes (e.g. `1`) | list | `[]` | no | |
24 |
| -| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `"-"` | no | |
25 |
| -| enabled | Set to false to prevent the module from creating any resources | string | `"true"` | no | |
26 |
| -| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `""` | no | |
27 |
| -| project | The project in which the resource belongs. If it is not provided, the provider project is used. | string | `""` | no | |
28 |
| -| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map | `{}` | no | |
| 32 | +| Name | Description | Type | Default | Required | |
| 33 | +|------|-------------|------|---------|:--------:| |
| 34 | +| additional\_tag\_map | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no | |
| 35 | +| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | |
| 36 | +| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no | |
| 37 | +| create\_service\_account\_key | Whether to create service account key | `bool` | `true` | no | |
| 38 | +| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | |
| 39 | +| description | A text description of the service account. | `string` | `"Managed by Terraform"` | no | |
| 40 | +| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no | |
| 41 | +| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | |
| 42 | +| id\_length\_limit | Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no | |
| 43 | +| keepers | Arbitrary map of values that, when changed, will trigger a new key to be generated. | `map(string)` | `null` | no | |
| 44 | +| key\_algorithm | The algorithm used to generate the key. Possible values: `KEY_ALG_UNSPECIFIED`, `KEY_ALG_RSA_1024`, `KEY_ALG_RSA_2048` | `string` | `"KEY_ALG_RSA_2048"` | no | |
| 45 | +| label\_key\_case | The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. | `string` | `"lower"` | no | |
| 46 | +| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no | |
| 47 | +| label\_value\_case | The letter case of output label values (also used in `tags` and `id`).<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Default value: `lower`. | `string` | `null` | no | |
| 48 | +| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no | |
| 49 | +| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no | |
| 50 | +| private\_key\_type | The output format of the private key. | `string` | `"TYPE_GOOGLE_CREDENTIALS_FILE"` | no | |
| 51 | +| project | The project in which the resource belongs. If it is not provided, the provider project is used. | `string` | `null` | no | |
| 52 | +| public\_key\_data | Public key data to create a service account key for given service account. The expected format for this field is a base64 encoded X509\_PEM and it conflicts with `public_key_type` and `private_key_type`. | `string` | `null` | no | |
| 53 | +| public\_key\_type | The output format of the public key requested. | `string` | `"TYPE_X509_PEM_FILE"` | no | |
| 54 | +| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | |
| 55 | +| roles | The list of roles that should be applied to service account. | `list(string)` | `[]` | no | |
| 56 | +| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | |
| 57 | +| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | |
29 | 58 |
|
30 | 59 | ## Outputs
|
31 | 60 |
|
32 |
| -| Name | Description | |
33 |
| -|:----------|:-------------------------------------------------| |
34 |
| -| email | The e-mail address of the service account. | |
35 |
| -| name | The fully-qualified name of the service account. | |
36 |
| -| unique_id | The unique id of the service account. | |
| 61 | +| Name | Description | |
| 62 | +|------|-------------| |
| 63 | +| email | The e-mail address of the service account. | |
| 64 | +| id | The id of the service account. | |
| 65 | +| key\_id | The id of the service account key. | |
| 66 | +| key\_name | The name of the service account key. | |
| 67 | +| name | The fully-qualified name of the service account. | |
| 68 | +| private\_key | The private key in JSON format, base64 encoded. | |
| 69 | +| public\_key | The public key, base64 encoded. | |
| 70 | +| unique\_id | The unique id of the service account. | |
| 71 | + |
| 72 | +<!--- END_TF_DOCS ---> |
| 73 | + |
| 74 | +## License |
| 75 | +The Apache-2.0 license |
0 commit comments