@@ -74,78 +74,80 @@ func ResourceDeployment() *schema.Resource {
7474 Optional : true ,
7575 Description : "Password for the first user of the deployment" ,
7676 },
77- "private_network" : {
78- Type : schema .TypeList ,
79- Optional : true ,
80- Computed : true ,
81- MaxItems : 1 ,
82- Description : "If set, creates a private endpoint. Provide pn_id." ,
83- Elem : & schema. Resource {
84- Schema : map [ string ] * schema.Schema {
85- // Input: private network ID
86- "pn_id" : {
87- Type : schema . TypeString ,
88- Optional : true ,
89- Description : "UUID of the private network for the endpoint" ,
90- } ,
91- // Computed fields returned from API:
92- "id" : {
93- Type : schema . TypeString ,
94- Computed : true ,
95- Description : "ID of the private endpoint (computed)" ,
96- } ,
97- "dns_record" : {
98- Type : schema . TypeString ,
99- Computed : true ,
100- Description : "DNS record assigned to the private endpoint (computed)" ,
101- } ,
102- "protocol" : {
103- Type : schema . TypeString ,
104- Computed : true ,
105- Description : "Service protocol (e.g. \" tcp \" , \" https \" , \" mysql \" ) for the private endpoint" ,
106- } ,
107- "port" : {
108- Type : schema . TypeInt ,
109- Computed : true ,
110- Description : "TCP port number for the private endpoint" ,
111- } ,
77+ "private_network" : {
78+ Type : schema .TypeList ,
79+ Optional : true ,
80+ Computed : true ,
81+ MaxItems : 1 ,
82+ Description : "If set, creates a private endpoint. Provide pn_id." ,
83+ AtLeastOneOf : [] string { "private_network" , "public_network" },
84+ Elem : & schema.Resource {
85+ Schema : map [ string ] * schema. Schema {
86+ // Input: private network ID
87+ "pn_id" : {
88+ Type : schema . TypeString ,
89+ Optional : true ,
90+ Description : "UUID of the private network for the endpoint" ,
91+ },
92+ // Computed fields returned from API:
93+ "id" : {
94+ Type : schema . TypeString ,
95+ Computed : true ,
96+ Description : "ID of the private endpoint (computed)" ,
97+ },
98+ "dns_record" : {
99+ Type : schema . TypeString ,
100+ Computed : true ,
101+ Description : "DNS record assigned to the private endpoint (computed)" ,
102+ },
103+ "protocol" : {
104+ Type : schema . TypeString ,
105+ Computed : true ,
106+ Description : "Service protocol (e.g. \" tcp \" , \" https \" , \" mysql \" ) for the private endpoint" ,
107+ },
108+ "port" : {
109+ Type : schema . TypeInt ,
110+ Computed : true ,
111+ Description : "TCP port number for the private endpoint" ,
112112 },
113113 },
114114 },
115+ },
115116
116- // Computed block: public_network (max 1). Only returned if a public endpoint exists.
117- "public_network" : {
118- Type : schema .TypeList ,
119- Optional : true ,
120- Computed : true ,
121- MaxItems : 1 ,
122- Description : "Details of the public endpoint (computed). " ,
123- Elem : & schema. Resource {
124- Schema : map [ string ] * schema.Schema {
125- "id" : {
126- Type : schema . TypeString ,
127- Computed : true ,
128- Description : "ID of the public endpoint (computed)" ,
129- } ,
130- "dns_record" : {
131- Type : schema . TypeString ,
132- Computed : true ,
133- Description : "DNS record for the public endpoint (computed)" ,
134- } ,
135- "protocol" : {
136- Type : schema . TypeString ,
137- Computed : true ,
138- Description : "Service protocol (e.g. \" tcp \" , \" https \" , \" mysql \" ) for the public endpoint" ,
139- } ,
140- "port" : {
141- Type : schema . TypeInt ,
142- Computed : true ,
143- Description : "TCP port number for the public endpoint" ,
144- } ,
117+ // Computed block: public_network (max 1). Only returned if a public endpoint exists.
118+ "public_network" : {
119+ Type : schema .TypeList ,
120+ Optional : true ,
121+ Computed : true ,
122+ MaxItems : 1 ,
123+ Description : "Details of the public endpoint (computed). At least one of private_network or public_network must be specified. " ,
124+ AtLeastOneOf : [] string { "private_network" , "public_network" },
125+ Elem : & schema.Resource {
126+ Schema : map [ string ] * schema. Schema {
127+ "id" : {
128+ Type : schema . TypeString ,
129+ Computed : true ,
130+ Description : "ID of the public endpoint (computed)" ,
131+ },
132+ "dns_record" : {
133+ Type : schema . TypeString ,
134+ Computed : true ,
135+ Description : "DNS record for the public endpoint (computed)" ,
136+ },
137+ "protocol" : {
138+ Type : schema . TypeString ,
139+ Computed : true ,
140+ Description : "Service protocol (e.g. \" tcp \" , \" https \" , \" mysql \" ) for the public endpoint" ,
141+ },
142+ "port" : {
143+ Type : schema . TypeInt ,
144+ Computed : true ,
145+ Description : "TCP port number for the public endpoint" ,
145146 },
146147 },
147148 },
148149 },
150+ },
149151 }
150152}
151153
0 commit comments