@@ -1669,14 +1669,50 @@ variable "gateway_api_enabled" {
16691669 description = " Enables the Gateway API Custom Resource Definitions (CRDs) deployment."
16701670}
16711671
1672+ variable "gateway_api_provider" {
1673+ type = string
1674+ default = " cilium"
1675+ description = " Specifies the Gateway API provider. Options are 'cilium' (Cilium Controller), or 'ingate' (InGate Ingress & Gateway API Controller)."
1676+
1677+ validation {
1678+ condition = contains ([" cilium" , " ingate" ], var. gateway_api_provider )
1679+ error_message = " Invalid Gateway API provider. Allowed values are 'cilium', or 'ingate'."
1680+ }
1681+
1682+ validation {
1683+ condition = var. gateway_api_provider != " cilium" || var. cilium_enabled
1684+ error_message = " Gateway API provider cannot be set to 'cilium' unless Cilium is also enabled."
1685+ }
1686+
1687+ validation {
1688+ condition = var. gateway_api_provider != " ingate"
1689+ error_message = " Gateway API provider 'ingate' is not yet supported."
1690+ }
1691+ }
1692+
16721693variable "gateway_api_version" {
16731694 type = string
16741695 default = " v1.3.0" # https://github.com/kubernetes-sigs/gateway-api
16751696 description = " Specifies the version of the Gateway API Custom Resource Definitions (CRDs) to deploy."
16761697
1698+ # Cilium provider constraints
1699+ validation {
1700+ condition = (
1701+ var. gateway_api_provider != " cilium" ||
1702+ (var. gateway_api_provider == " cilium" &&
1703+ var. cilium_helm_version == " v1.18.2" &&
1704+ var. gateway_api_version == " v1.3.0" )
1705+ )
1706+ error_message = " When gateway_api_provider is 'cilium', cilium_helm_version must be 'v1.18.2' and gateway_api_version must be 'v1.3.0'."
1707+ }
1708+
1709+ # InGate provider constraints (will also fail due to provider-level validation)
16771710 validation {
1678- condition = var. ingress_controller_type != " cilium" || (var. cilium_helm_version == " v1.18.2" && var. gateway_api_version == " v1.3.0" )
1679- error_message = " When ingress_controller_type is 'cilium', cilium_helm_version must be 'v1.18.2' and gateway_api_version must be 'v1.3.0'."
1711+ condition = (
1712+ var. gateway_api_provider != " ingate" ||
1713+ (var. gateway_api_provider == " ingate" && var. gateway_api_version == " v1.2.0" )
1714+ )
1715+ error_message = " When gateway_api_provider is 'ingate', gateway_api_version must be 'v1.2.0'."
16801716 }
16811717}
16821718
0 commit comments