Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions examples/custom-vpc-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,48 @@ In this example we add Terraform modules to two Google Cloud regions.
- Cloud Scheduler Job

## Sample Code
Define your `versions.tf` as follows:
```hcl
terraform {
required_version = ">= 1.5"

required_providers {
lacework = {
source = "lacework/lacework"
}
}
}
```

Define your `main.tf` as follows:
```hcl
provider "lacework" {}
# Set your Lacework profile here. With the Lacework CLI, use
# `lacework configure list` to get a list of available profiles.
provider "lacework" {
profile = "lw_agentless"
}

/*
This provider will be used to deploy AWLS's global scanning resources. As such, it must be assigned as
the provider in the per-region AWLS module block where `global == true`.
For reference, see module "lacework_gcp_agentless_scanning_project_multi_region_<alias1>", which
has `global = true` and therefore is where we set this provider as the google provider.
*/
provider "google" {
alias = "use1"
region = "us-east1"
alias = <alias1>
region = <region1>
# Set the project in which the scanning resources will be hosted.
project = <your-project-id>
}

provider "google" {
alias = "usc1"
region = "us-central1"
alias = <alias2>
region = <region2>

# Set your default project ID for this region. This isn't required for
# the Agentless integration, but is required by the Google Provider.
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#configuring-the-provider
project = "default-project-id"
}

locals {
Expand Down Expand Up @@ -75,32 +105,34 @@ resource "google_compute_firewall" "rules" {
}
}

module "lacework_gcp_agentless_scanning_project_multi_region_use1" {
module "lacework_gcp_agentless_scanning_project_multi_region_<alias1>" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

providers = {
google = google.use1
google = google.<alias1>
}

project_filter_list = local.project_filter_list

organization_id = <your-org-id>
global = true
regional = true

custom_vpc_subnet = google_compute_subnetwork.awls_subnet_1.id
}

module "lacework_gcp_agentless_scanning_project_multi_region_usc1" {
module "lacework_gcp_agentless_scanning_project_multi_region_<alias2>" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

providers = {
google = google.usc1
google = google.<alias2>
}

project_filter_list = local.project_filter_list

organization_id = <your-org-id>
regional = true
global_module_reference = module.lacework_gcp_agentless_scanning_project_multi_region_use1

Expand Down
63 changes: 52 additions & 11 deletions examples/org-level-multi-region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,82 @@ In this example we add Terraform modules to two Google Cloud regions.

## Sample Code

Define your `versions.tf` as follows:
```hcl
provider "lacework" {}
terraform {
required_version = ">= 1.5"

required_providers {
lacework = {
source = "lacework/lacework"
}
}
}
```

Define your `main.tf` as follows:
```hcl
# Set your Lacework profile here. With the Lacework CLI, use
# `lacework configure list` to get a list of available profiles.
provider "lacework" {
profile = "lw_agentless"
}

/*
This provider will be used to deploy AWLS's global scanning resources. As such, it must be assigned as
the provider in the per-region AWLS module block where `global == true`.
For reference, see module "lacework_gcp_agentless_scanning_org_multi_region", which
has `global = true` and therefore is where we set this provider as the google provider.
*/
provider "google" {
alias = "use1"
region = "us-east1"
alias = <alias1>
region = <region1>
# Set the project in which the scanning resources will be hosted.
project = <your-project-id>
}

provider "google" {
alias = "usc1"
region = "us-central1"
alias = <alias2>
region = <region2>

# Set your default project ID for this region. This isn't required for
# the Agentless integration, but is required by the Google Provider.
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#configuring-the-provider
project = "default-project-id"
}

module "lacework_gcp_agentless_scanning_org_multi_region" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

providers = {
google = google.use1
google = google.<alias1>
}

# Provide a list of Google Cloud projects and/or folders that you want to monitor here.
# For projects, enter the project ID.
# If the project_filter_list is omitted, all projects and folders in the organization are scanned.
#project_filter_list = [
# "monitored-project-1",
# "monitored-project-2",
# "folder/monitored-folder-1",
# "folder/monitored-folder-2
#]

integration_type = "ORGANIZATION"
organization_id = "123456789012"
organization_id = <your-org-id>

global = true
regional = true
lacework_integration_name = "agentless_from_terraform"
}

module "lacework_gcp_agentless_scanning_org_multi_region_usc1" {
module "lacework_gcp_agentless_scanning_org_multi_region_<alias2>" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

providers = {
google = google.usc1
google = google.<alias2>
}

regional = true
Expand Down
42 changes: 38 additions & 4 deletions examples/org-level-single-region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,51 @@ In this example we add Terraform modules to one Google Cloud region.

## Sample Code

Define your `versions.tf` as follows:
```hcl
provider "lacework" {}
terraform {
required_version = ">= 1.5"

provider "google" {}
required_providers {
lacework = {
source = "lacework/lacework"
}
}
}
```

Define your `main.tf` as follows:
```hcl
# Set your Lacework profile here. With the Lacework CLI, use
# `lacework configure list` to get a list of available profiles.
provider "lacework" {
profile = "lw_agentless"
}

provider "google" {
# Set the ID of the project where the scanning resources are hosted.
project = <your-project-id>

# Set the region where the scanning resources are hosted.
region = <region>
}

module "lacework_gcp_agentless_scanning_org_single_region" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

# Provide a list of Google Cloud projects and/or folders that you want to monitor here.
# For projects, enter the project ID.
# If the project_filter_list is omitted, all projects and folders in the organization are scanned.
#project_filter_list = [
# "monitored-project-1",
# "monitored-project-2",
# "folder/monitored-folder-1",
# "folder/monitored-folder-2
#]

integration_type = "ORGANIZATION"
organization_id = "123456789012"
organization_id = <your-org-id>

global = true
regional = true
Expand Down
57 changes: 46 additions & 11 deletions examples/project-level-multi-region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,81 @@ In this example we add Terraform modules to two Google Cloud regions.

## Sample Code

Define your `versions.tf` as follows:
```hcl
provider "lacework" {}
terraform {
required_version = ">= 1.5"

required_providers {
lacework = {
source = "lacework/lacework"
}
}
}
```

Define your `main.tf` as follows:
```hcl
# Set your Lacework profile here. With the Lacework CLI, use
# `lacework configure list` to get a list of available profiles.
provider "lacework" {
profile = "lw_agentless"
}

/*
This provider will be used to deploy AWLS's global scanning resources. As such, it must be assigned as
the provider in the per-region AWLS module block where `global == true`.
For reference, see module "lacework_gcp_agentless_scanning_project_multi_region_<alias1>", which
has `global = true` and therefore is where we set this provider as the google provider.
*/
provider "google" {
alias = "use1"
region = "us-east1"
alias = <alias1>
region = <region1>
# Set the project in which the scanning resources will be hosted.
project = <your-project-id>
}

provider "google" {
alias = "usc1"
region = "us-central1"
alias = <alias2>
region = <region2>

# Set your default project ID for this region. This isn't required for
# the Agentless integration, but is required by the Google Provider.
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#configuring-the-provider
project = "default-project-id"
}

module "lacework_gcp_agentless_scanning_project_multi_region_use1" {
module "lacework_gcp_agentless_scanning_project_multi_region_<alias1>" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

providers = {
google = google.use1
google = google.<alias1>
}

# Provide the list of Google Cloud projects that you want to monitor here.
# Enter the ID of the projects.
project_filter_list = [
"monitored-project-1",
"monitored-project-2"
]

global = true
regional = true
organization_id = <your-org-id>
lacework_integration_name = "agentless_from_terraform"
}

module "lacework_gcp_agentless_scanning_project_multi_region_usc1" {
module "lacework_gcp_agentless_scanning_project_multi_region_<alias2>" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

providers = {
google = google.usc1
}

regional = true
global_module_reference = module.lacework_gcp_agentless_scanning_project_multi_region_use1
organization_id = <your-org-id>
global_module_reference = module.lacework_gcp_agentless_scanning_project_multi_region_<alias1>
}
```
33 changes: 30 additions & 3 deletions examples/project-level-single-region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,49 @@ In this example we add Terraform modules to one Google Cloud region.

## Sample Code

Define your `versions.tf` as follows:
```hcl
provider "lacework" {}
terraform {
required_version = ">= 1.5"

required_providers {
lacework = {
source = "lacework/lacework"
}
}
}
```

provider "google" {}
Define your `main.tf` as follows:
```hcl
# Set your Lacework profile here. With the Lacework CLI, use
# `lacework configure list` to get a list of available profiles.
provider "lacework" {
profile = "lw_agentless"
}

provider "google" {
# Set the ID of the project where the scanning resources are hosted.
project = <your-project-id>

# Set the region where the scanning resources are hosted.
region = <region>
}

module "lacework_gcp_agentless_scanning_project_single_region" {
source = "lacework/agentless-scanning/gcp"
version = "~> 0.1"
version = "~> 2.0"

# Provide the list of Google Cloud projects that you want to monitor here.
# Enter the ID of the projects.
project_filter_list = [
"monitored-project-1",
"monitored-project-2"
]

global = true
regional = true
organization_id = <your-org-id>
lacework_integration_name = "agentless_from_terraform"
}
```