Skip to content

Commit 8949f86

Browse files
sameer-iniru
andauthored
feat(bench) adding random schedule for benchmark tasks (#47)
* adding random schedule for benchmark tasks * chore: docs/lint * chore: remove kitchen tf version verif Co-authored-by: iru <irune.prado@sysdig.com>
1 parent f96e0cc commit 8949f86

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

.kitchen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ driver:
33
name: terraform
44
root_module_directory: test/fixtures
55
parallelism: 4
6+
verify_version: false
67

78
provisioner:
89
name: terraform

examples/organizational/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Minimum requirements:
2424
> You must be logged in with the management account for the organization to create an organization trail. You must also have sufficient permissions for the IAM user or role in the management account to successfully create an organization trail.
2525
* When an account is created within an organization, AWS will create an `OrganizationAccountAccessRole` [for account management](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html), which Sysdig Secure for Cloud will use for member-account provisioning and role assuming.
2626
* However, when the account is invited into the organization, it's required to [create the role manually](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role)
27-
> You have to do this manually, as shown in the following procedure. This essentially duplicates the role automatically set up for created accounts. We recommend that you use the same name, OrganizationAccountAccessRole, for your manually created roles for consistency and ease of remembering.
27+
> You have to do this manually, as shown in the following procedure. This essentially duplicates the role automatically set up for created accounts. We recommend that you use the same name, OrganizationAccountAccessRole, for your manually created roles for consistency and ease of remembering.
2828
* This role name, `OrganizationAccountAccessRole`, is currently hardcoded on the module.
2929
3. Provide a member **account ID for Sysdig Secure for Cloud workload** to be deployed.
3030
Our recommendation is for this account to be empty, so that deployed resources are not mixed up with your workload.

modules/services/cloud-bench/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ Deploys
1414
|------|---------|
1515
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.15.0 |
1616
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.62.0 |
17+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.1.0 |
1718
| <a name="requirement_sysdig"></a> [sysdig](#requirement\_sysdig) | >= 0.5.21 |
1819

1920
## Providers
2021

2122
| Name | Version |
2223
|------|---------|
2324
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.62.0 |
25+
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.1.0 |
2426
| <a name="provider_sysdig"></a> [sysdig](#provider\_sysdig) | >= 0.5.21 |
2527

2628
## Modules
@@ -35,6 +37,8 @@ No modules.
3537
| [aws_cloudformation_stack_set_instance.stackset_instance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set_instance) | resource |
3638
| [aws_iam_role.cloudbench_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
3739
| [aws_iam_role_policy_attachment.cloudbench_security_audit](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
40+
| [random_integer.hour](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) | resource |
41+
| [random_integer.minute](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) | resource |
3842
| [sysdig_secure_benchmark_task.benchmark_task](https://registry.terraform.io/providers/sysdiglabs/sysdig/latest/docs/resources/secure_benchmark_task) | resource |
3943
| [sysdig_secure_cloud_account.cloud_account](https://registry.terraform.io/providers/sysdiglabs/sysdig/latest/docs/resources/secure_cloud_account) | resource |
4044
| [aws_caller_identity.me](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |

modules/services/cloud-bench/main.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,19 @@ locals {
4040
)
4141
}
4242

43+
resource "random_integer" "minute" {
44+
max = 59
45+
min = 0
46+
}
47+
48+
resource "random_integer" "hour" {
49+
max = 23
50+
min = 0
51+
}
52+
4353
resource "sysdig_secure_benchmark_task" "benchmark_task" {
4454
name = "Sysdig Secure for Cloud (AWS) - ${local.benchmark_task_name}"
45-
schedule = "0 6 * * *"
55+
schedule = "${random_integer.minute.result} ${random_integer.hour.result} * * *"
4656
schema = "aws_foundations_bench-1.3.0"
4757
scope = "${local.accounts_scope_clause}${local.regions_scope_clause}"
4858

modules/services/cloud-bench/versions.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
terraform {
22
required_version = ">= 0.15.0"
33
required_providers {
4+
random = {
5+
source = "hashicorp/random"
6+
version = ">= 3.1.0"
7+
}
8+
49
aws = {
510
version = ">= 3.62.0"
611
}

0 commit comments

Comments
 (0)