File tree Expand file tree Collapse file tree
modules/network/gpu-rdma-vpc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ limitations under the License.
9797
9898## Providers
9999
100- No providers.
100+ | Name | Version |
101+ |------|---------|
102+ | <a name="provider_terraform"></a> [terraform](#provider\_ terraform) | n/a |
101103
102104## Modules
103105
@@ -107,7 +109,9 @@ No providers.
107109
108110## Resources
109111
110- No resources.
112+ | Name | Type |
113+ |------|------|
114+ | [terraform_data.network_profile_validation](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/resources/data) | resource |
111115
112116## Inputs
113117
Original file line number Diff line number Diff line change @@ -82,3 +82,16 @@ module "vpc" {
8282 firewall_rules = local. firewall_rules
8383 network_profile = var. network_profile
8484}
85+
86+ resource "terraform_data" "network_profile_validation" {
87+ lifecycle {
88+ precondition {
89+ condition = (
90+ can (regex (" vpc-roce-metal" , var. network_profile )) ?
91+ var. subnetworks_template == null :
92+ var. subnetworks_template != null
93+ )
94+ error_message = " subnetworks_template must be null when using 'vpc-roce-metal' network profile and non-null for all other profiles."
95+ }
96+ }
97+ }
Original file line number Diff line number Diff line change @@ -64,16 +64,6 @@ variable "subnetworks_template" {
6464 region = null
6565 }
6666
67- validation {
68- # If it's NOT a RoCE Metal profile, the template cannot be null
69- condition = (
70- can (regex (" vpc-roce-metal" , var. network_profile )) ?
71- var. subnetworks_template == null :
72- var. subnetworks_template != null
73- )
74- error_message = " subnetworks_template must be null when using 'vpc-roce-metal' network profile and non-null for all other profiles."
75- }
76-
7767 validation {
7868 # If template is provided, count must be > 0
7969 condition = var. subnetworks_template == null ? true : var. subnetworks_template . count > 0
You can’t perform that action at this time.
0 commit comments