Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make terraform module variables nullable #79

Merged
merged 1 commit into from
Dec 8, 2023
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
9 changes: 9 additions & 0 deletions aks/application/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ variable "cluster_configuration_map" {

variable "replicas" {
type = number
nullable = false
default = 1
description = "Number of application instances"
}
Expand Down Expand Up @@ -64,42 +65,49 @@ variable "docker_image" {

variable "command" {
type = list(string)
nullable = false
default = []
description = "Custom command that overwrites Docker image"
}

variable "max_memory" {
type = string
nullable = false
default = "1Gi"
description = "Maximum memory of the instance"
}

variable "is_web" {
type = bool
nullable = false
default = true
description = "Whether this a web application"
}

variable "web_external_hostnames" {
type = list(string)
nullable = false
default = []
description = "List of external hostnames for the web application"
}

variable "web_port" {
type = number
nullable = false
default = 3000
description = "Port of the web application"
}

variable "probe_path" {
type = string
nullable = false
default = "/healthcheck"
description = "Path for the liveness and startup probe. The probe can be disabled by setting this to null."
}

variable "probe_command" {
type = list(string)
nullable = false
default = []
description = "Command for the liveness and startup probe"
}
Expand All @@ -123,6 +131,7 @@ variable "azure_resource_prefix" {

variable "azure_enable_monitoring" {
type = bool
nullable = false
default = false
description = "Whether to enable monitoring of container failures"
}
3 changes: 3 additions & 0 deletions aks/application_configuration/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ variable "config_short" {

variable "is_rails_application" {
type = bool
nullable = false
default = false
description = "If true, sets config variables for a Rails application"
}

variable "config_variables" {
type = map(string)
nullable = false
default = {}
description = "Additional configuration variables"
}
Expand All @@ -55,6 +57,7 @@ variable "secret_yaml_key" {

variable "secret_variables" {
type = map(string)
nullable = false
default = {}
description = "Additional secret variables"
}
22 changes: 14 additions & 8 deletions aks/postgres/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ variable "cluster_configuration_map" {

variable "server_docker_image" {
type = string
nullable = false
default = "postgres:14-alpine"
description = "Database image to use with kubernetes deployment, eg. postgis/postgis:14-3.4"
}
Expand Down Expand Up @@ -85,13 +86,15 @@ variable "azure_sku_name" {
}

variable "azure_enable_high_availability" {
type = bool
default = false
type = bool
nullable = false
default = false
}

variable "azure_extensions" {
type = list(string)
default = []
type = list(string)
nullable = false
default = []
}

variable "azure_memory_threshold" {
Expand All @@ -110,12 +113,14 @@ variable "azure_storage_threshold" {
}

variable "azure_enable_monitoring" {
type = bool
default = true
type = bool
nullable = false
default = true
}

variable "alert_window_size" {
type = string
nullable = false
default = "PT5M"
description = "The period of time that is used to monitor alert activity e.g PT1M, PT5M, PT15M, PT30M, PT1H, PT6H or PT12H"
}
Expand All @@ -130,6 +135,7 @@ variable "azure_maintenance_window" {
}

variable "azure_enable_backup_storage" {
type = bool
default = true
type = bool
nullable = false
default = true
}
25 changes: 16 additions & 9 deletions aks/redis/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ variable "cluster_configuration_map" {

variable "server_version" {
type = string
nullable = false
default = "6"
description = "Version of Redis server"
}
Expand All @@ -71,13 +72,15 @@ variable "azure_sku_name" {
}

variable "azure_minimum_tls_version" {
type = string
default = "1.2"
type = string
nullable = false
default = "1.2"
}

variable "azure_public_network_access_enabled" {
type = bool
default = false
type = bool
nullable = false
default = false
}

variable "azure_memory_threshold" {
Expand All @@ -86,13 +89,15 @@ variable "azure_memory_threshold" {
}

variable "azure_maxmemory_policy" {
type = string
default = "allkeys-lru"
type = string
nullable = false
default = "allkeys-lru"
}

variable "azure_enable_monitoring" {
type = bool
default = true
type = bool
nullable = false
default = true
}

variable "azure_patch_schedule" {
Expand All @@ -101,12 +106,14 @@ variable "azure_patch_schedule" {
start_hour_utc = optional(number),
maintenance_window = optional(string)
}))
default = []
nullable = false
default = []
}

variable "alert_window_size" {
type = string
default = "PT5M"
nullable = false
description = "The period of time that is used to monitor alert activity e.g PT1M, PT5M, PT15M, PT30M, PT1H, PT6H or PT12H"
}

13 changes: 9 additions & 4 deletions domains/environment_domains/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ variable "host_name" {
}

variable "null_host_header" {
nullable = false
default = false
description = "The origin_host_header for the azurerm_cdn_frontdoor_origin resource will be var.host_name (if false) or null (if true). If null then the host name from the incoming request will be used."
}

variable "rule_set_ids" {
type = list(any)
default = []
type = list(any)
nullable = false
default = []
}

variable "multiple_hosted_zones" {
type = bool
default = false
type = bool
nullable = false
default = false
}

variable "cached_paths" {
Expand All @@ -34,11 +37,13 @@ variable "cached_paths" {
}

variable "exclude_cnames" {
nullable = false
default = []
description = "Don't create the CNAME for this record from var.domains. We set this when we want to configure front door for a services domain that we are migrating so we do not need to wait for the certificate to validate and front door to propagate the configuration."
}

variable "redirect_rules" {
nullable = false
default = {}
description = <<EOF
List of ordered redirect rules with format:
Expand Down
6 changes: 4 additions & 2 deletions domains/infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ variable "hosted_zone" {
}

variable "deploy_default_records" {
type = bool
default = true
nullable = false
type = bool
default = true
}

variable "tags" {
default = null
}

variable "azure_enable_monitoring" {
nullable = false
type = bool
description = "Enable monitoring and logging in Azure"
default = false
Expand Down
4 changes: 4 additions & 0 deletions monitoring/statuscake/variables.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
variable "uptime_urls" {
type = list(string)
nullable = false
description = "Set of URLs to perform uptime checks on"
default = []
}

variable "ssl_urls" {
type = list(string)
nullable = false
description = "Set of URLs to perform SSL checks on"
default = []
}

variable "contact_groups" {
type = list(string)
nullable = false
description = "Contact groups for the alerts"
default = []
}

variable "confirmation" {
type = number
nullable = false
description = "Retry the check when an error is detected to avoid false positives and micro downtimes"
default = 2
}
Loading