Skip to content

Commit e43a222

Browse files
authored
fix(cvm): [122618670] fix the conflict error while create cvm instance (#3429)
* fix the error while create cvm instance * fix the error while create cvm instance
1 parent 9f02a18 commit e43a222

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

.changelog/3429.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_instance: fix the at least error while creating cvm instance
3+
```

tencentcloud/services/cvm/resource_tc_instance.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ func ResourceTencentCloudInstance() *schema.Resource {
7474
Optional: true,
7575
Computed: true,
7676
ValidateFunc: tccommon.ValidateInstanceType,
77-
AtLeastOneOf: []string{"instance_type", "launch_template_id"},
7877
Description: "The type of the instance.",
7978
},
8079
"hostname": {
@@ -199,18 +198,16 @@ func ResourceTencentCloudInstance() *schema.Resource {
199198
},
200199
// vpc
201200
"vpc_id": {
202-
Type: schema.TypeString,
203-
Optional: true,
204-
Computed: true,
205-
AtLeastOneOf: []string{"vpc_id", "launch_template_id"},
206-
Description: "The ID of a VPC network. If you want to create instances in a VPC network, this parameter must be set.",
201+
Type: schema.TypeString,
202+
Optional: true,
203+
Computed: true,
204+
Description: "The ID of a VPC network. If you want to create instances in a VPC network, this parameter must be set.",
207205
},
208206
"subnet_id": {
209-
Type: schema.TypeString,
210-
Optional: true,
211-
Computed: true,
212-
AtLeastOneOf: []string{"subnet_id", "launch_template_id"},
213-
Description: "The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.",
207+
Type: schema.TypeString,
208+
Optional: true,
209+
Computed: true,
210+
Description: "The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.",
214211
},
215212
"private_ip": {
216213
Type: schema.TypeString,
@@ -225,7 +222,6 @@ func ResourceTencentCloudInstance() *schema.Resource {
225222
Optional: true,
226223
Computed: true,
227224
ConflictsWith: []string{"orderly_security_groups"},
228-
AtLeastOneOf: []string{"security_groups", "launch_template_id"},
229225
Description: "A list of security group IDs to associate with.",
230226
Deprecated: "It will be deprecated. Use `orderly_security_groups` instead.",
231227
},
@@ -236,7 +232,6 @@ func ResourceTencentCloudInstance() *schema.Resource {
236232
Optional: true,
237233
Computed: true,
238234
ConflictsWith: []string{"security_groups"},
239-
AtLeastOneOf: []string{"orderly_security_groups", "launch_template_id"},
240235
Description: "A list of orderly security group IDs to associate with.",
241236
},
242237
// storage

0 commit comments

Comments
 (0)