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
2 changes: 1 addition & 1 deletion nullplatform/asset/docker_server/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "nullplatform_provider_config" "docker_server" {
nrn = var.nrn
type = "docker-server"
dimensions = {}
dimensions = var.dimensions
attributes = jsonencode({
"setup" : {
"server" : var.login_server,
Expand Down
6 changes: 6 additions & 0 deletions nullplatform/asset/docker_server/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ variable "password" {
type = string
sensitive = false
}

variable "dimensions" {
description = "Dimensions to segment the nullplatform provider config (e.g. by region, environment)"
type = map(string)
default = {}
}
2 changes: 1 addition & 1 deletion nullplatform/asset/ecr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "nullplatform_provider_config" "ecr" {
provider = nullplatform
nrn = var.nrn
type = "ecr"
dimensions = {}
dimensions = var.dimensions
attributes = jsonencode({
"ci" : {
"region" : data.aws_region.current.region,
Expand Down
6 changes: 6 additions & 0 deletions nullplatform/asset/ecr/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ variable "cluster_name" {
description = "Name of the cluster where the policy runs"
type = string
}

variable "dimensions" {
description = "Dimensions to segment the nullplatform provider config (e.g. by region, environment)"
type = map(string)
default = {}
}
5 changes: 2 additions & 3 deletions nullplatform/cloud/aws/cloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "nullplatform_provider_config" "aws" {
provider = nullplatform
nrn = var.nrn
type = "aws-configuration"
dimensions = {}
dimensions = var.dimensions
attributes = jsonencode({
iam = {
#scope_workflow_role = aws_iam_role.nullplatform_scope_workflow_role.arn
Expand All @@ -21,5 +21,4 @@ resource "nullplatform_provider_config" "aws" {
lifecycle {
ignore_changes = [attributes]
}
}

}
6 changes: 3 additions & 3 deletions nullplatform/code_repository/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "nullplatform_provider_config" "gitlab" {
count = local.is_gitlab ? 1 : 0
nrn = try(regex("(.*):namespace.*", var.nrn)[0], var.nrn)
type = "gitlab-configuration"
dimensions = {}
dimensions = var.dimensions
attributes = jsonencode({
"setup" : {
"group_path" : var.gitlab_group_path,
Expand All @@ -23,7 +23,7 @@ resource "nullplatform_provider_config" "github" {
count = local.is_github ? 1 : 0
nrn = replace(var.nrn, ":namespace=.*$", "")
type = "github-configuration"
dimensions = {}
dimensions = var.dimensions
attributes = jsonencode({
"setup" : {
"organization" : var.github_organization,
Expand All @@ -41,7 +41,7 @@ resource "nullplatform_provider_config" "azure" {
count = local.is_azure ? 1 : 0
nrn = replace(var.nrn, ":namespace=.*$", "")
type = "azure-devops-configuration"
dimensions = {}
dimensions = var.dimensions
attributes = jsonencode({
"setup" : {
"project" : var.azure_project,
Expand Down
6 changes: 6 additions & 0 deletions nullplatform/code_repository/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,9 @@ variable "nrn" {
description = "Nullplatform Resource Name (NRN) — unique identifier for resources."
type = string
}

variable "dimensions" {
description = "Dimensions to segment the nullplatform provider config (e.g. by region, environment)"
type = map(string)
default = {}
}
13 changes: 9 additions & 4 deletions nullplatform/container_orchestration/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ locals {
var.use_nullplatform_namespace ? { use_nullplatform_namespace = var.use_nullplatform_namespace } : {},
)

balancer = { for k, v in {
public_name = var.public_balancer_name
private_name = var.private_balancer_name
} : k => v if v != "" }
balancer = merge(
{ for k, v in {
public_name = var.public_balancer_name
private_name = var.private_balancer_name
} : k => v if v != "" },
var.alb_capacity_threshold != null ? { alb_capacity_threshold = var.alb_capacity_threshold } : {},
length(var.additional_public_balancer_names) > 0 ? { additional_public_names = var.additional_public_balancer_names } : {},
length(var.additional_private_balancer_names) > 0 ? { additional_private_names = var.additional_private_balancer_names } : {},
)

network = { for k, v in {
balancer_group_suffix = var.balancer_group_suffix
Expand Down
31 changes: 31 additions & 0 deletions nullplatform/container_orchestration/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,43 @@ variable "public_balancer_name" {
default = ""
}

variable "additional_public_balancer_names" {
description = "Additional public-facing load balancers to support scope deployments beyond the 100-rule ALB limit"
type = list(string)
default = []
validation {
condition = alltrue([for name in var.additional_public_balancer_names : can(regex("^[a-zA-Z0-9][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$|^[a-zA-Z0-9]$", name))])
error_message = "ALB names must be 1-32 characters, only alphanumeric and hyphens, and cannot start or end with a hyphen."
}
}

variable "private_balancer_name" {
description = "The name of the private load balancer for internal traffic routing"
type = string
default = ""
}

variable "additional_private_balancer_names" {
description = "Additional private load balancers to support scope deployments beyond the 100-rule ALB limit"
type = list(string)
default = []
validation {
condition = alltrue([for name in var.additional_private_balancer_names : can(regex("^[a-zA-Z0-9][a-zA-Z0-9-]{0,30}[a-zA-Z0-9]$|^[a-zA-Z0-9]$", name))])
error_message = "ALB names must be 1-32 characters, only alphanumeric and hyphens, and cannot start or end with a hyphen."
}
}

variable "alb_capacity_threshold" {
description = "Maximum ALB rule usage percentage (50-99). The remaining capacity reserves slots for concurrent deployments. Higher values maximize ALB utilization but increase the risk of hitting the rule limit"
type = number
default = null
nullable = true
validation {
condition = var.alb_capacity_threshold == null || (var.alb_capacity_threshold >= 50 && var.alb_capacity_threshold <= 99)
error_message = "alb_capacity_threshold must be between 50 and 99."
}
}

variable "balancer_group_suffix" {
description = "Suffix added to the ALB name, enabling management across multiple clusters in the same account"
type = string
Expand Down
Loading