Skip to content

Commit c888c69

Browse files
authored
feat(cvm): [119927671] tencentcloud_instance support disable_automation_service params (#2873)
* add * add * add
1 parent 816dbf0 commit c888c69

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.changelog/2873.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: support `disable_automation_service` params
3+
```

tencentcloud/services/cvm/resource_tc_instance.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ func ResourceTencentCloudInstance() *schema.Resource {
325325
Default: false,
326326
Description: "Disable enhance service for monitor, it is enabled by default. When this options is set, monitor agent won't be installed. Modifying will cause the instance reset.",
327327
},
328+
"disable_automation_service": {
329+
Type: schema.TypeBool,
330+
Optional: true,
331+
Default: false,
332+
Description: "Disable enhance service for automation, it is enabled by default. When this options is set, monitor agent won't be installed. Modifying will cause the instance reset.",
333+
},
328334
// login
329335
"key_name": {
330336
Type: schema.TypeString,
@@ -662,6 +668,13 @@ func resourceTencentCloudInstanceCreate(d *schema.ResourceData, meta interface{}
662668
}
663669
}
664670

671+
if v, ok := d.GetOkExists("disable_automation_service"); ok {
672+
automationService := !(v.(bool))
673+
request.EnhancedService.AutomationService = &cvm.RunAutomationServiceEnabled{
674+
Enabled: &automationService,
675+
}
676+
}
677+
665678
// login
666679
request.LoginSettings = &cvm.LoginSettings{}
667680
keyIds := d.Get("key_ids").(*schema.Set).List()
@@ -1233,6 +1246,7 @@ func resourceTencentCloudInstanceUpdate(d *schema.ResourceData, meta interface{}
12331246
d.HasChange("hostname") ||
12341247
d.HasChange("disable_security_service") ||
12351248
d.HasChange("disable_monitor_service") ||
1249+
d.HasChange("disable_automation_service") ||
12361250
d.HasChange("keep_image_login") {
12371251

12381252
request := cvm.NewResetInstanceRequest()
@@ -1264,6 +1278,14 @@ func resourceTencentCloudInstanceUpdate(d *schema.ResourceData, meta interface{}
12641278
}
12651279
}
12661280

1281+
if d.HasChange("disable_automation_service") {
1282+
v := d.Get("disable_automation_service")
1283+
automationService := !(v.(bool))
1284+
request.EnhancedService.AutomationService = &cvm.RunAutomationServiceEnabled{
1285+
Enabled: &automationService,
1286+
}
1287+
}
1288+
12671289
// Modify or keep login info when instance reset
12681290
request.LoginSettings = &cvm.LoginSettings{}
12691291

website/docs/r/instance.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ The following arguments are supported:
225225
* `data_disks` - (Optional, List, ForceNew) Settings for data disks.
226226
* `dedicated_cluster_id` - (Optional, String, ForceNew) Exclusive cluster id.
227227
* `disable_api_termination` - (Optional, Bool) Whether the termination protection is enabled. Default is `false`. If set true, which means that this instance can not be deleted by an API action.
228+
* `disable_automation_service` - (Optional, Bool) Disable enhance service for automation, it is enabled by default. When this options is set, monitor agent won't be installed. Modifying will cause the instance reset.
228229
* `disable_monitor_service` - (Optional, Bool) Disable enhance service for monitor, it is enabled by default. When this options is set, monitor agent won't be installed. Modifying will cause the instance reset.
229230
* `disable_security_service` - (Optional, Bool) Disable enhance service for security, it is enabled by default. When this options is set, security agent won't be installed. Modifying will cause the instance reset.
230231
* `force_delete` - (Optional, Bool) Indicate whether to force delete the instance. Default is `false`. If set true, the instance will be permanently deleted instead of being moved into the recycle bin. Note: only works for `PREPAID` instance.

0 commit comments

Comments
 (0)