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
* Fix README hyperlinks, split region variable in two variables, one for BQ and one for the CF, update required provider versions
* add link to BigQuery and Cloud Function locations
* adjust terraform version
* simplify readme
* change Requirements section
* Chnage required version in example to 0.13.66
* revert required version change
Copy file name to clipboardExpand all lines: examples/bq-log-alerting/README.md
+47-22Lines changed: 47 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,29 +2,17 @@
2
2
3
3
This example deploys the BigQuery Log Alerting submodule in an existing project.
4
4
5
-
## Prerequisites
5
+
## Requirements
6
6
7
-
To run this example, you'll need:
7
+
Make sure you have the requirements listed in the submodule [README](../../modules/bq-log-alerting/README.md) Before running this example.
8
8
9
-
- An existing "logging" project
10
-
- A [Log export](https://github.com/terraform-google-modules/terraform-google-log-export) with a [BigQuery destination](https://github.com/terraform-google-modules/terraform-google-log-export/tree/master/modules/bigquery) in the logging project. The export filter should include at least:
- A Terraform Service Account with the [IAM Roles](../../../modules/bq-log-alerting/README.md) listed in the submodule documentation.
15
-
- To enable in the logging project the [APIs](../../../modules/bq-log-alerting/README.md) listed in the submodule documentation.
16
-
- To enable in the logging project [Google App Engine](https://cloud.google.com/appengine).
17
-
To enable it manually use:
18
-
19
-
```shell
20
-
gcloud app create \
21
-
--region=<REGION> \
22
-
--project=<LOGGING_PROJECT>
23
-
```
9
+
## Instructions
24
10
25
-
**Note 1:** The selected Google App Engine region cannot be changed after creation and only project Owners (`role/owner`) can enable Google App Engine.
11
+
### Check if the Source "BQ Log Alerts" exist
26
12
27
-
**Note 2:** On deployment a Security Command Center Source called "BQ Log Alerts" will be created. If this source already exist due to the submodule been deployed at least once before, you need to obtain the existing Source name to be informed in the terraform variable **source_name**.
13
+
On deployment a Security Command Center Source called "BQ Log Alerts" will be created.
14
+
If this source already exist due to the submodule been deployed at least once before,
15
+
you need to obtain the existing Source name to be informed in the terraform variable **source_name**.
The source name format is `organizations/<ORG_ID>/sources/<SOURCE_ID>`.
38
26
39
-
The [terraform-example-foundation](https://github.com/terraform-google-modules/terraform-example-foundation) can be used as a reference for the creation of the logging project, the service account and the log export.
27
+
### Activate impersonation of the service account
40
28
41
-
## Instructions
29
+
To activate impersonation on the service account you can:
30
+
31
+
Set the `gcloud` config auth impersonation:
32
+
33
+
```shell
34
+
gcloud config set auth/impersonate_service_account <TERRAFORM_SERVICE_ACCOUNT_EMAIL>
35
+
```
36
+
37
+
Or
38
+
39
+
Change the [versions.tf](./versions.tf) file to set [impersonation on the provider](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#impersonate_service_account):
| bigquery\_location | Location for BigQuery resources. See https://cloud.google.com/bigquery/docs/locations for valid values. |`string`|`"US"`| no |
77
+
| function\_region | Region for the Cloud function resources. See https://cloud.google.com/functions/docs/locations for valid values. |`string`| n/a | yes |
52
78
| logging\_project | The project to deploy the submodule |`string`| n/a | yes |
53
79
| org\_id | The organization ID for the associated services |`string`| n/a | yes |
54
-
| region | Region for BigQuery resources. |`string`| n/a | yes |
55
80
| source\_name | The Security Command Center Source name for the "BQ Log Alerts" Source if the source had been created before. The format is `organizations/<ORG_ID>/sources/<SOURCE_ID>`|`string`|`""`| no |
Copy file name to clipboardExpand all lines: examples/bq-log-alerting/variables.tf
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,17 @@ variable "org_id" {
19
19
type=string
20
20
}
21
21
22
-
variable"region" {
23
-
description="Region for BigQuery resources."
22
+
variable"function_region" {
23
+
description="Region for the Cloud function resources. See https://cloud.google.com/functions/docs/locations for valid values."
24
24
type=string
25
25
}
26
26
27
+
variable"bigquery_location" {
28
+
description="Location for BigQuery resources. See https://cloud.google.com/bigquery/docs/locations for valid values."
29
+
type=string
30
+
default="US"
31
+
}
32
+
27
33
variable"source_name" {
28
34
description="The Security Command Center Source name for the \"BQ Log Alerts\" Source if the source had been created before. The format is `organizations/<ORG_ID>/sources/<SOURCE_ID>`"
0 commit comments