Skip to content

Commit ae6d434

Browse files
chore(bench): Remove verbose default region clause (#22)
1 parent 9644519 commit ae6d434

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

modules/services/cloud-bench/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ No modules.
3737
| [sysdig_secure_cloud_account.cloud_account](https://registry.terraform.io/providers/sysdiglabs/sysdig/latest/docs/resources/secure_cloud_account) | resource |
3838
| [aws_iam_policy.security_audit](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy) | data source |
3939
| [aws_iam_policy_document.trust_relationship](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
40-
| [aws_regions.regions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/regions) | data source |
4140
| [sysdig_secure_trusted_cloud_identity.trusted_identity](https://registry.terraform.io/providers/sysdiglabs/sysdig/latest/docs/data-sources/secure_trusted_cloud_identity) | data source |
4241

4342
## Inputs

modules/services/cloud-bench/main.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ data "sysdig_secure_trusted_cloud_identity" "trusted_identity" {
1111
cloud_provider = "aws"
1212
}
1313

14-
data "aws_regions" "regions" {
15-
all_regions = true
16-
}
17-
1814
locals {
19-
regions = length(var.regions) == 0 ? data.aws_regions.regions.names : var.regions
15+
regions_scope_clause = length(var.regions) == 0 ? "" : " and aws.region in (\"${join("\", \"", var.regions)}\")"
2016
}
2117

2218
resource "sysdig_secure_benchmark_task" "benchmark_task" {
2319
name = "Sysdig Secure for Cloud (AWS) - ${var.account_id}"
2420
schedule = "0 6 * * *"
2521
schema = "aws_foundations_bench-1.3.0"
26-
scope = "aws.accountId = \"${var.account_id}\" and aws.region in (\"${join("\", \"", local.regions)}\")"
22+
scope = "aws.accountId = \"${var.account_id}\"${local.regions_scope_clause}"
2723

2824
# Creation of a task requires that the Cloud Account already exists in the backend, and has `role_enabled = true`
2925
depends_on = [sysdig_secure_cloud_account.cloud_account]

0 commit comments

Comments
 (0)