Patrick de Ruiter 8a2341423a
Some checks failed
Code Quality & Security Scan / TFLint (push) Successful in 19s
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 27s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 37s
Code Quality & Security Scan / Terraform Validate (push) Failing after 32s
Code Quality & Security Scan / SonarQube Trigger (push) Has been skipped
Fix Terraform validation errors
- Fix ansible_host resource: use 'name' and 'variables' instead of 'inventory_hostname' and 'vars'
- Add missing Vault authentication variables: role_id and secret_id
- Update CI/CD pipeline to provide dummy auth variables for validation
- Run terraform fmt
2025-11-10 12:17:58 +01:00

43 lines
1.1 KiB
HCL
Executable File

variable "environment" {
type = string
description = "Environment name (e.g., dev, staging, prod, test)"
validation {
condition = can(regex("^[a-zA-Z0-9-_]+$", var.environment))
error_message = "Environment must contain only alphanumeric characters, hyphens, and underscores."
}
}
variable "short_hostname" {
type = string
description = "Short hostname for the target server"
validation {
condition = can(regex("^[a-zA-Z0-9-]+$", var.short_hostname))
error_message = "Hostname must contain only alphanumeric characters and hyphens."
}
}
variable "vault_address" {
type = string
description = "Vault server address (e.g., https://vault.example.com:8200)"
validation {
condition = can(regex("^https?://", var.vault_address))
error_message = "Vault address must be a valid HTTP or HTTPS URL."
}
}
variable "role_id" {
type = string
description = "Vault AppRole role_id for authentication"
sensitive = true
}
variable "secret_id" {
type = string
description = "Vault AppRole secret_id for authentication"
sensitive = true
}