Skip to content
Open
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 terraform/implementations/aws/observ-infra/aws.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ enable_rancher_keycloak_integration = true

# Rancher import (same as infra)
enable_rancher_import = false
rancher_import_url = "\"<rancher-import-url>\""
rancher_import_url = ""

# Security group CIDRs
network_cidr = "10.0.0.0/8" # Use your actual VPC CIDR
Expand Down
9 changes: 5 additions & 4 deletions terraform/infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ variable "enable_rancher_import" {
}

variable "rancher_import_url" {
description = "Rancher import URL for kubectl apply"
description = "Rancher import URL for kubectl apply. Can be empty when enable_rancher_import is false."
type = string
default = ""
validation {
condition = (
can(regex("^\"kubectl apply -f https://rancher\\.mosip\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.rancher_import_url)) ||
can(regex("^\"kubectl apply -f https://rancher\\.[a-zA-Z0-9\\*\\.\\-]+\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.rancher_import_url))
var.rancher_import_url == "" ||
can(regex("^\"kubectl apply -f https://[a-zA-Z0-9][a-zA-Z0-9\\-\\.]+[a-zA-Z0-9]\\.[a-zA-Z]{2,}/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.rancher_import_url))
)
error_message = "The RANCHER_IMPORT_URL must be in the format: '\"kubectl apply -f https://rancher.mosip.net/v3/import/<ID>.yaml\"' or '\"kubectl apply -f https://rancher.***.net/v3/import/<ID>.yaml\"'"
error_message = "The rancher_import_url must be empty or in the format: '\"kubectl apply -f https://<domain>/v3/import/<ID>.yaml\"'"
}
}

Expand Down
17 changes: 5 additions & 12 deletions terraform/modules/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,16 @@ variable "ENABLE_RANCHER_IMPORT" {
default = false
}
variable "RANCHER_IMPORT_URL" {
description = "Rancher import URL for kubectl apply"
description = "Rancher import URL for kubectl apply. Can be empty when ENABLE_RANCHER_IMPORT is false."
type = string

default = ""
validation {
condition = (
can(regex("^\"kubectl apply -f https://rancher\\.mosip\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.RANCHER_IMPORT_URL)) ||
can(regex("^\"kubectl apply -f https://rancher\\.[a-zA-Z0-9\\*\\.\\-]+\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.RANCHER_IMPORT_URL))
var.RANCHER_IMPORT_URL == "" ||
can(regex("^\"kubectl apply -f https://[a-zA-Z0-9][a-zA-Z0-9\\-\\.]+[a-zA-Z0-9]\\.[a-zA-Z]{2,}/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.RANCHER_IMPORT_URL))
)
error_message = "The RANCHER_IMPORT_URL must be in the format: '\"kubectl apply -f https://rancher.mosip.net/v3/import/<ID>.yaml\"' or '\"kubectl apply -f https://rancher.***.net/v3/import/<ID>.yaml\"'"
error_message = "The RANCHER_IMPORT_URL must be empty or in the format: '\"kubectl apply -f https://<domain>/v3/import/<ID>.yaml\"'"
}
# validation {
# condition = (
# var.RANCHER_IMPORT_URL == "" ||
# can(regex("^\"kubectl apply -f https://rancher\\.mosip\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.RANCHER_IMPORT_URL))
# )
# error_message = "The RANCHER_IMPORT_URL must be empty or in the format: '\"kubectl apply -f https://rancher.mosip.net/v3/import/<ID>.yaml\"'"
# }
}

variable "CLUSTER_ENV_DOMAIN" {
Expand Down
9 changes: 5 additions & 4 deletions terraform/observ-infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ variable "enable_rancher_import" {
}

variable "rancher_import_url" {
description = "Rancher import URL for kubectl apply"
description = "Rancher import URL for kubectl apply. Can be empty when enable_rancher_import is false."
type = string
default = ""
validation {
condition = (
can(regex("^\"kubectl apply -f https://rancher\\.mosip\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.rancher_import_url)) ||
can(regex("^\"kubectl apply -f https://rancher\\.[a-zA-Z0-9\\*\\.\\-]+\\.net/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.rancher_import_url))
var.rancher_import_url == "" ||
can(regex("^\"kubectl apply -f https://[a-zA-Z0-9][a-zA-Z0-9\\-\\.]+[a-zA-Z0-9]\\.[a-zA-Z]{2,}/v3/import/[a-zA-Z0-9_\\-]+\\.yaml\"$", var.rancher_import_url))
)
error_message = "The RANCHER_IMPORT_URL must be in the format: '\"kubectl apply -f https://rancher.mosip.net/v3/import/<ID>.yaml\"' or '\"kubectl apply -f https://rancher.***.net/v3/import/<ID>.yaml\"'"
error_message = "The rancher_import_url must be empty or in the format: '\"kubectl apply -f https://<domain>/v3/import/<ID>.yaml\"'"
}
}

Expand Down