@@ -115,6 +115,16 @@ func ResourceTencentCloudTkeClusterEndpoint() *schema.Resource {
115
115
Computed : true ,
116
116
Description : "The Intranet address used for access." ,
117
117
},
118
+ "kube_config" : {
119
+ Type : schema .TypeString ,
120
+ Computed : true ,
121
+ Description : "The Intranet address used for access." ,
122
+ },
123
+ "kube_config_intranet" : {
124
+ Type : schema .TypeString ,
125
+ Computed : true ,
126
+ Description : "Kubernetes config of private network." ,
127
+ },
118
128
},
119
129
}
120
130
}
@@ -169,6 +179,45 @@ func resourceTencentCloudTkeClusterEndpointRead(d *schema.ResourceData, meta int
169
179
// _ = d.Set("managed_cluster_internet_security_policies", security.SecurityPolicy)
170
180
//}
171
181
182
+ var config string
183
+ clusterInternet := d .Get ("cluster_internet" ).(bool )
184
+ clusterIntranet := d .Get ("cluster_intranet" ).(bool )
185
+ if clusterInternet {
186
+ err = resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
187
+ result , e := service .DescribeClusterConfig (ctx , id , true )
188
+ if e != nil {
189
+ return tccommon .RetryError (e )
190
+ }
191
+
192
+ config = result
193
+ return nil
194
+ })
195
+
196
+ if err != nil {
197
+ return err
198
+ }
199
+
200
+ _ = d .Set ("kube_config" , config )
201
+ }
202
+
203
+ if clusterIntranet {
204
+ err = resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
205
+ result , e := service .DescribeClusterConfig (ctx , id , false )
206
+ if e != nil {
207
+ return tccommon .RetryError (e )
208
+ }
209
+
210
+ config = result
211
+ return nil
212
+ })
213
+
214
+ if err != nil {
215
+ return err
216
+ }
217
+
218
+ _ = d .Set ("kube_config_intranet" , config )
219
+ }
220
+
172
221
return nil
173
222
}
174
223
0 commit comments