Skip to content

Commit ec5f4d4

Browse files
jon-stewartafiunelacework-aaronscheiber
authored
docs: multi project (#80)
* docs: multi project * chore: apply suggestions from code review * chore: apply suggestions from code review Co-authored-by: lacework-aaronscheiber <[email protected]> --------- Co-authored-by: Salim Afiune <[email protected]> Co-authored-by: lacework-aaronscheiber <[email protected]>
1 parent 2f81f83 commit ec5f4d4

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Integrate Multiple Google Cloud Projects with Lacework for Configuration Assessment
2+
The following provides an example of integrating multiple Google Cloud projects with Lacework for cloud resource configuration assessment.
3+
4+
The fields required for this example are:
5+
6+
| Name | Description | Type |
7+
|------------|---------------------------------------------------------------------------------------------|----------|
8+
| `projects` | The ID of each project, which will be used to deploy required resources for the integration | `map` |
9+
10+
11+
```hcl
12+
provider "google" {
13+
project = keys(var.projects)[0]
14+
}
15+
16+
provider "lacework" {}
17+
18+
variable "projects" {
19+
description = "Map of project configuration with Lacework."
20+
type = map
21+
default = {
22+
project-id-1 = "first project",
23+
project-id-2 = "second project"
24+
}
25+
}
26+
27+
module "gcp_project_config" {
28+
source = "lacework/config/gcp"
29+
version = "~> 2.0"
30+
31+
for_each = var.projects
32+
project_id = each.key
33+
}
34+
```
35+
36+
Run Terraform:
37+
```
38+
$ terraform init
39+
$ GOOGLE_CREDENTIALS=account.json terraform apply
40+
```
41+
42+
For detailed information on integrating Lacework with Google Cloud see [GCP Compliance and Audit Trail Integration - Configure Multiple Porjects with Terraform](https://docs.lacework.com/onboarding/gcp-compliance-and-audit-log-integration-terraform-using-google-cloud-shell#configure-multiple-projects-with-terraform)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
provider "google" {
2+
project = keys(var.projects)[0]
3+
}
4+
5+
provider "lacework" {}
6+
7+
variable "projects" {
8+
description = "Map of project configuration with Lacework."
9+
type = map
10+
default = {
11+
project-id-1 = "first project",
12+
project-id-2 = "second project"
13+
}
14+
}
15+
16+
module "gcp_project_config" {
17+
source = "../../"
18+
19+
for_each = var.projects
20+
project_id = each.key
21+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# required for Terraform 13
2+
terraform {
3+
required_providers {
4+
google = "~> 4.36"
5+
lacework = {
6+
source = "lacework/lacework"
7+
}
8+
}
9+
10+
11+
}

0 commit comments

Comments
 (0)