|
| 1 | +# Automatic Labelling for folder projects |
| 2 | + |
| 3 | +This example demonstrates how to use the |
| 4 | +[root module][root-module] that will contain source |
| 5 | +code files generated from Terraform itself. |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +To provision this example, populate `terraform.tfvars` with the [required variables](#inputs) and run the following commands within |
| 10 | +this directory: |
| 11 | + |
| 12 | +- `terraform init` to initialize the directory |
| 13 | +- `terraform plan` to generate the execution plan |
| 14 | +- `terraform apply` to apply the execution plan |
| 15 | +- `terraform destroy` to destroy the infrastructure |
| 16 | + |
| 17 | +<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 18 | +## Inputs |
| 19 | + |
| 20 | +| Name | Description | Type | Default | Required | |
| 21 | +|------|-------------|:----:|:-----:|:-----:| |
| 22 | +| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes | |
| 23 | +| region | The region in which resources will be applied. | string | n/a | yes | |
| 24 | + |
| 25 | +## Outputs |
| 26 | + |
| 27 | +| Name | Description | |
| 28 | +|------|-------------| |
| 29 | +| function\_name | The name of the function created | |
| 30 | +| random\_file\_string | The content of the terraform created file in the source directory. | |
| 31 | +| region | The region in which resources are applied. | |
| 32 | + |
| 33 | +<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 34 | + |
| 35 | +## Requirements |
| 36 | + |
| 37 | +The following sections describe the requirements which must be met in |
| 38 | +order to invoke this module. The requirements of the |
| 39 | +[root module][root-module-requirements] and the |
| 40 | +[event-folder-log-entry submodule][event-folder-log-entry-submodule-requirements] |
| 41 | +must also be met. |
| 42 | + |
| 43 | +### Software Dependencies |
| 44 | + |
| 45 | +The following software dependencies must be installed on the system |
| 46 | +from which this module will be invoked: |
| 47 | + |
| 48 | +- [Terraform][terraform-site] v0.12 |
| 49 | + |
| 50 | +### IAM Roles |
| 51 | + |
| 52 | +The Service Account which will be used to invoke this module must have |
| 53 | +the following IAM roles: |
| 54 | + |
| 55 | +- Logs Configuration Writer: `roles/logging.configWriter` |
| 56 | +- Pub/Sub Admin: `roles/pubsub.admin` |
| 57 | +- Service Account User: `roles/iam.serviceAccountUser` |
| 58 | + |
| 59 | +- Default AppSpot user: `roles/owner` |
| 60 | +- Your user: `roles/resourcemanager.projectCreator` |
| 61 | + |
| 62 | +### APIs |
| 63 | + |
| 64 | +The project against which this module will be invoked must have the |
| 65 | +following APIs enabled: |
| 66 | + |
| 67 | +- Cloud Pub/Sub API: `pubsub.googleapis.com` |
| 68 | +- Stackdriver Logging API: `logging.googleapis.com` |
| 69 | + |
| 70 | +[event-folder-log-entry-submodule-requirements]: ../../modules/event-folder-log-entry/README.md#requirements |
| 71 | +[event-folder-log-entry-submodule]: ../../modules/event-folder-log-entry |
| 72 | +[root-module-requirements]: ../../README.md#requirements |
| 73 | +[root-module]: ../.. |
| 74 | +[terraform-site]: https://terraform.io/ |
0 commit comments