Skip to content

Commit

Permalink
feat: cpu and memory as parameters (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
regiluze authored Feb 14, 2022
1 parent ff042d5 commit 42aae19
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/single-subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ Notice that:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_sysdig_secure_api_token"></a> [sysdig\_secure\_api\_token](#input\_sysdig\_secure\_api\_token) | Sysdig's Secure API Token | `string` | n/a | yes |
| <a name="input_cpu"></a> [cpu](#input\_cpu) | Number of CPU cores of the containers | `string` | `"0.5"` | no |
| <a name="input_deploy_active_directory"></a> [deploy\_active\_directory](#input\_deploy\_active\_directory) | whether the Active Directory features are to be deployed | `bool` | `true` | no |
| <a name="input_deploy_benchmark"></a> [deploy\_benchmark](#input\_deploy\_benchmark) | whether benchmark module is to be deployed | `bool` | `true` | no |
| <a name="input_deploy_scanning"></a> [deploy\_scanning](#input\_deploy\_scanning) | whether scanning module is to be deployed | `bool` | `true` | no |
| <a name="input_location"></a> [location](#input\_location) | Zone where the stack will be deployed | `string` | `"westus"` | no |
| <a name="input_memory"></a> [memory](#input\_memory) | Number of CPU cores of the containers | `string` | `"1"` | no |
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc"` | no |
| <a name="input_region"></a> [region](#input\_region) | Region in which to run benchmarks. Azure accepts one of [AzureCloud, AzureChinaCloud, AzureGermanCloud, AzureUSGovernment]. | `string` | `"AzureCloud"` | no |
| <a name="input_registry_name"></a> [registry\_name](#input\_registry\_name) | The existing Container Registry name | `string` | `""` | no |
Expand Down
2 changes: 2 additions & 0 deletions examples/single-subscription/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ module "cloud_connector" {
sysdig_secure_api_token = var.sysdig_secure_api_token
sysdig_secure_endpoint = var.sysdig_secure_endpoint
verify_ssl = local.verify_ssl
cpu = var.cpu
memory = var.memory
tags = var.tags
subscription_id = data.azurerm_subscription.current.subscription_id
}
12 changes: 12 additions & 0 deletions examples/single-subscription/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ variable "registry_resource_group_name" {
description = "The existing Container Registry name resource group name when is different than workload resource group name"
}

variable "cpu" {
type = string
default = "0.5"
description = "Number of CPU cores of the containers"
}

variable "memory" {
type = string
default = "1"
description = "Number of CPU cores of the containers"
}

variable "deploy_active_directory" {
type = bool
default = true
Expand Down
2 changes: 2 additions & 0 deletions examples/tenant-subscriptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ Notice that:
|------|-------------|------|---------|:--------:|
| <a name="input_sysdig_secure_api_token"></a> [sysdig\_secure\_api\_token](#input\_sysdig\_secure\_api\_token) | Sysdig's Secure API Token | `string` | n/a | yes |
| <a name="input_benchmark_subscription_ids"></a> [benchmark\_subscription\_ids](#input\_benchmark\_subscription\_ids) | Azure subscription IDs to run Benchmarks on. If no subscriptions are specified, all of the tenant will be used. | `list(string)` | `[]` | no |
| <a name="input_cpu"></a> [cpu](#input\_cpu) | Number of CPU cores of the containers | `string` | `"0.5"` | no |
| <a name="input_deploy_active_directory"></a> [deploy\_active\_directory](#input\_deploy\_active\_directory) | whether the Active Directory features are to be deployed | `bool` | `true` | no |
| <a name="input_deploy_benchmark"></a> [deploy\_benchmark](#input\_deploy\_benchmark) | whether benchmark module is to be deployed | `bool` | `true` | no |
| <a name="input_deploy_scanning"></a> [deploy\_scanning](#input\_deploy\_scanning) | whether scanning module is to be deployed | `bool` | `true` | no |
| <a name="input_location"></a> [location](#input\_location) | Zone where the stack will be deployed | `string` | `"westus"` | no |
| <a name="input_memory"></a> [memory](#input\_memory) | Number of CPU cores of the containers | `string` | `"1"` | no |
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc"` | no |
| <a name="input_region"></a> [region](#input\_region) | Region in which to run benchmarks. Azure accepts one of [AzureCloud, AzureChinaCloud, AzureGermanCloud, AzureUSGovernment]. | `string` | `"AzureCloud"` | no |
| <a name="input_registry_name"></a> [registry\_name](#input\_registry\_name) | The existing Container Registry name | `string` | `""` | no |
Expand Down
2 changes: 2 additions & 0 deletions examples/tenant-subscriptions/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ module "cloud_connector" {
client_id = local.client_id
client_secret = local.client_secret
location = var.location
cpu = var.cpu
memory = var.memory
sysdig_secure_api_token = var.sysdig_secure_api_token
sysdig_secure_endpoint = var.sysdig_secure_endpoint
verify_ssl = local.verify_ssl
Expand Down
12 changes: 12 additions & 0 deletions examples/tenant-subscriptions/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ variable "region" {
default = "AzureCloud"
}

variable "cpu" {
type = string
default = "0.5"
description = "Number of CPU cores of the containers"
}

variable "memory" {
type = string
default = "1"
description = "Number of CPU cores of the containers"
}

variable "benchmark_subscription_ids" {
default = []
type = list(string)
Expand Down
2 changes: 2 additions & 0 deletions modules/services/cloud-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ No modules.
| <a name="input_tenant_id"></a> [tenant\_id](#input\_tenant\_id) | Azure tenant ID | `string` | n/a | yes |
| <a name="input_config_content"></a> [config\_content](#input\_config\_content) | Configuration contents for the file stored in the bucket | `string` | `null` | no |
| <a name="input_config_source"></a> [config\_source](#input\_config\_source) | Path to a file that contains the contents of the configuration file to be saved in the bucket | `string` | `null` | no |
| <a name="input_cpu"></a> [cpu](#input\_cpu) | Number of CPU cores of the containers | `string` | `"0.5"` | no |
| <a name="input_deploy_scanning"></a> [deploy\_scanning](#input\_deploy\_scanning) | whether scanning module is to be deployed | `bool` | `false` | no |
| <a name="input_image"></a> [image](#input\_image) | Image of the cloud-connector to deploy | `string` | `"quay.io/sysdig/cloud-connector:latest"` | no |
| <a name="input_memory"></a> [memory](#input\_memory) | Number of CPU cores of the containers | `string` | `"1"` | no |
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc-connector"` | no |
| <a name="input_sysdig_secure_endpoint"></a> [sysdig\_secure\_endpoint](#input\_sysdig\_secure\_endpoint) | Sysdig's Secure API URL | `string` | `"https://secure.sysdig.com/"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be added to the resources | `map(string)` | <pre>{<br> "product": "sysdig-secure-for-cloud"<br>}</pre> | no |
Expand Down
4 changes: 2 additions & 2 deletions modules/services/cloud-connector/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ resource "azurerm_container_group" "cg" {
container {
name = "${var.name}-container"
image = var.image
cpu = "1"
memory = "2"
cpu = var.cpu
memory = var.memory

environment_variables = local.env_vars

Expand Down
12 changes: 12 additions & 0 deletions modules/services/cloud-connector/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ variable "resource_group_name" {
description = "The resource group name to deploy cloud vision stack"
}

variable "cpu" {
type = string
default = "0.5"
description = "Number of CPU cores of the containers"
}

variable "memory" {
type = string
default = "1"
description = "Number of CPU cores of the containers"
}

variable "tags" {
type = map(string)
description = "Tags to be added to the resources"
Expand Down

0 comments on commit 42aae19

Please sign in to comment.