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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ Notice that:

Workaround: Need to restore the identity pool/provider and then import them into terraform with
```bash
# re-activate
# re-activate
$ gcloud iam workload-identity-pools undelete sysdigcloud --location=global

# import to terraform state
$ terraform import module.secure-for-cloud_example_single-project.module.cloud_bench.google_iam_workload_identity_pool.pool sysdigcloud
$ terraform import module.secure-for-cloud_example_single-project.module.cloud_bench.google_iam_workload_identity_pool_provider.pool_provider sysdigcloud/sysdigcloud
```



<br/><br/>
## Authors
Expand Down
2 changes: 1 addition & 1 deletion examples/organization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module "secure-for-cloud_example_organization" {
| <a name="input_create_gcr_topic"></a> [create\_gcr\_topic](#input\_create\_gcr\_topic) | Deploys a PubSub topic called `gcr` as part of this stack, which is needed for GCR scanning. Set to `true` only if it doesn't exist yet. If this is not deployed, and no existing `gcr` topic is found, the GCR scanning is ommited and won't be deployed. For more info see [GCR PubSub topic](https://cloud.google.com/container-registry/docs/configuring-notifications#create_a_topic). | `bool` | `true` | no |
| <a name="input_location"></a> [location](#input\_location) | Zone where the stack will be deployed | `string` | `"us-central1"` | no |
| <a name="input_max_instances"></a> [max\_instances](#input\_max\_instances) | Max number of instances for the workloads | `number` | `1` | no |
| <a name="input_naming_prefix"></a> [naming\_prefix](#input\_naming\_prefix) | Naming prefix for all the resources created | `string` | `"secure-for-cloud"` | no |
| <a name="input_naming_prefix"></a> [naming\_prefix](#input\_naming\_prefix) | Naming prefix for all the resources created | `string` | `"sfc"` | no |
| <a name="input_sysdig_secure_endpoint"></a> [sysdig\_secure\_endpoint](#input\_sysdig\_secure\_endpoint) | Sysdig Secure API endpoint | `string` | `"https://secure.sysdig.com"` | no |

## Outputs
Expand Down
3 changes: 2 additions & 1 deletion examples/organization/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,6 @@ module "cloud_bench" {
for_each = toset(local.benchmark_projects_ids)
source = "../../modules/services/cloud-bench"

project_id = each.key
naming_prefix = var.naming_prefix
project_id = each.key
}
9 changes: 8 additions & 1 deletion examples/organization/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ variable "project_id" {
description = "organizational member project ID where the secure-for-cloud workload is going to be deployed"
}

# Vars with defaults
# --------------------------
# optionals, with defaults
# --------------------------
variable "location" {
type = string
default = "us-central1"
Expand All @@ -31,6 +33,11 @@ variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}

variable "max_instances" {
Expand Down
9 changes: 8 additions & 1 deletion examples/single-project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ variable "project_id" {
description = "Project ID"
}

# Vars with defaults
# --------------------------
# optionals, with defaults
# --------------------------
variable "location" {
type = string
default = "us-central1"
Expand All @@ -26,6 +28,11 @@ variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}

variable "create_gcr_topic" {
Expand Down
9 changes: 8 additions & 1 deletion modules/infrastructure/organization_sink/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ variable "organization_id" {
description = "Numeric ID of the organization to be exported to the sink"
}

# Vars with defaults
# --------------------------
# optionals, with defaults
# --------------------------
variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}
9 changes: 8 additions & 1 deletion modules/infrastructure/project_sink/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ variable "filter" {
description = "Filter for project sink"
}

# Vars with defaults
# --------------------------
# optionals, with defaults
# --------------------------
variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}
10 changes: 8 additions & 2 deletions modules/infrastructure/secrets/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ variable "sysdig_secure_api_token" {
sensitive = true
}

# Default vars

# --------------------------
# optionals, with defaults
# --------------------------
variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}
1 change: 1 addition & 0 deletions modules/services/cloud-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_naming_prefix"></a> [naming\_prefix](#input\_naming\_prefix) | Naming prefix for all the resources created | `string` | `"sfc"` | no |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | ID of project to run the benchmark on | `string` | `""` | no |
| <a name="input_regions"></a> [regions](#input\_regions) | List of regions in which to run the benchmark. If empty, the task will contain all regions by default. | `list(string)` | `[]` | no |
| <a name="input_role_name"></a> [role\_name](#input\_role\_name) | The name of the Service Account that will be created. | `string` | `"sysdigcloudbench"` | no |
Expand Down
5 changes: 3 additions & 2 deletions modules/services/cloud-bench/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,16 @@ resource "google_iam_workload_identity_pool" "pool" {
project = var.project_id

provider = google-beta
workload_identity_pool_id = "sysdigcloud"
workload_identity_pool_id = "${var.naming_prefix}-sysdigcloud"
display_name = "sysdigcloud"
}

resource "google_iam_workload_identity_pool_provider" "pool_provider" {
project = var.project_id

provider = google-beta
workload_identity_pool_id = google_iam_workload_identity_pool.pool.workload_identity_pool_id
workload_identity_pool_provider_id = "sysdigcloud"
workload_identity_pool_provider_id = "${var.naming_prefix}-sysdigcloud"
display_name = "Sysdigcloud"
description = "Sysdig Secure for Cloud"
disabled = false
Expand Down
15 changes: 15 additions & 0 deletions modules/services/cloud-bench/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ variable "role_name" {
description = "The name of the Service Account that will be created."
default = "sysdigcloudbench"
}


# --------------------------
# optionals, with defaults
# --------------------------
variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}
9 changes: 8 additions & 1 deletion modules/services/cloud-connector/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ variable "project_id" {
description = "organizational member project ID where the secure-for-cloud workload is going to be deployed"
}

# Vars with defaults
# --------------------------
# optionals, with defaults
# --------------------------

variable "verify_ssl" {
type = bool
Expand Down Expand Up @@ -55,6 +57,11 @@ variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}

variable "max_instances" {
Expand Down
10 changes: 9 additions & 1 deletion modules/services/cloud-scanning/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ variable "project_id" {
description = "organizational member project ID where the secure-for-cloud workload is going to be deployed"
}

# vars with defaults

# --------------------------
# optionals, with defaults
# --------------------------

variable "verify_ssl" {
type = bool
Expand Down Expand Up @@ -65,6 +68,11 @@ variable "naming_prefix" {
type = string
description = "Naming prefix for all the resources created"
default = "sfc"

validation {
condition = can(regex("^[a-z0-9_]+$", var.naming_prefix))
error_message = "ERROR: Invalid naming_prefix. must contain only lowercase letters (a-z) and numbers (0-9)."
}
}

variable "max_instances" {
Expand Down