Skip to content

fix(as): [119957253] tencentcloud_as_scaling_config add enhanced_automation_tools_service params #2875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2875.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_as_scaling_config: Supports `enhanced_automation_tools_service` params.
```
21 changes: 20 additions & 1 deletion tencentcloud/services/as/resource_tc_as_scaling_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ func ResourceTencentCloudAsScalingConfig() *schema.Resource {
Default: true,
Description: "To specify whether to enable cloud monitor service. Default is `TRUE`.",
},
"enhanced_automation_tools_service": {
Type: schema.TypeBool,
Optional: true,
Default: true,
Description: "To specify whether to enable cloud automation tools service. Default is `TRUE`.",
},
"user_data": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -383,6 +389,12 @@ func resourceTencentCloudAsScalingConfigCreate(d *schema.ResourceData, meta inte
Enabled: &monitorService,
}
}
if v, ok := d.GetOkExists("enhanced_automation_tools_service"); ok {
automationToolsService := v.(bool)
request.EnhancedService.AutomationToolsService = &as.RunAutomationServiceEnabled{
Enabled: &automationToolsService,
}
}

if v, ok := d.GetOk("user_data"); ok {
request.UserData = helper.String(v.(string))
Expand Down Expand Up @@ -532,6 +544,7 @@ func resourceTencentCloudAsScalingConfigRead(d *schema.ResourceData, meta interf
_ = d.Set("security_group_ids", helper.StringsInterfaces(config.SecurityGroupIds))
_ = d.Set("enhanced_security_service", *config.EnhancedService.SecurityService.Enabled)
_ = d.Set("enhanced_monitor_service", *config.EnhancedService.MonitorService.Enabled)
_ = d.Set("enhanced_automation_tools_service", *config.EnhancedService.AutomationToolsService.Enabled)
_ = d.Set("user_data", helper.PString(config.UserData))
_ = d.Set("instance_tags", flattenInstanceTagsMapping(config.InstanceTags))
_ = d.Set("disk_type_policy", *config.DiskTypePolicy)
Expand Down Expand Up @@ -687,7 +700,7 @@ func resourceTencentCloudAsScalingConfigUpdate(d *schema.ResourceData, meta inte
}
}

if d.HasChange("enhanced_security_service") || d.HasChange("enhanced_monitor_service") {
if d.HasChange("enhanced_security_service") || d.HasChange("enhanced_monitor_service") || d.HasChange("enhanced_automation_tools_service") {
request.EnhancedService = &as.EnhancedService{}

if v, ok := d.GetOkExists("enhanced_security_service"); ok {
Expand All @@ -702,6 +715,12 @@ func resourceTencentCloudAsScalingConfigUpdate(d *schema.ResourceData, meta inte
Enabled: &monitorService,
}
}
if v, ok := d.GetOkExists("enhanced_automation_tools_service"); ok {
automationToolsService := v.(bool)
request.EnhancedService.AutomationToolsService = &as.RunAutomationServiceEnabled{
Enabled: &automationToolsService,
}
}
}

if d.HasChange("user_data") {
Expand Down
34 changes: 18 additions & 16 deletions tencentcloud/services/as/resource_tc_as_scaling_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ resource "tencentcloud_as_scaling_config" "example" {
disk_size = 50
}

internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
internet_max_bandwidth_out = 10
public_ip_assigned = true
password = "Test@123#"
enhanced_security_service = false
enhanced_monitor_service = false
user_data = "dGVzdA=="
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
internet_max_bandwidth_out = 10
public_ip_assigned = true
password = "Test@123#"
enhanced_security_service = false
enhanced_monitor_service = false
enhanced_automation_tools_service = false
user_data = "dGVzdA=="

host_name_settings {
host_name = "host-name-test"
host_name_style = "UNIQUE"
host_name = "host-name-test"
host_name_style = "UNIQUE"
}

instance_tags = {
Expand All @@ -44,7 +45,7 @@ resource "tencentcloud_as_scaling_config" "example" {

Using `SPOTPAID` charge type

```
```hcl
data "tencentcloud_images" "example" {
image_type = ["PUBLIC_IMAGE"]
os_name = "TencentOS Server 3.2 (Final)"
Expand All @@ -62,13 +63,14 @@ resource "tencentcloud_as_scaling_config" "example" {

Using image family

```
```hcl
resource "tencentcloud_as_scaling_config" "example" {
image_family = "business-daily-update"
configuration_name = "as-test-config"
disk_type_policy = "ORIGINAL"
enhanced_monitor_service = false
enhanced_security_service = false
image_family = "business-daily-update"
configuration_name = "as-test-config"
disk_type_policy = "ORIGINAL"
enhanced_monitor_service = false
enhanced_security_service = false
enhanced_automation_tools_service = false
instance_tags = {}
instance_types = [
"S5.SMALL2",
Expand Down
29 changes: 16 additions & 13 deletions website/docs/r/as_scaling_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ resource "tencentcloud_as_scaling_config" "example" {
disk_size = 50
}

internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
internet_max_bandwidth_out = 10
public_ip_assigned = true
password = "Test@123#"
enhanced_security_service = false
enhanced_monitor_service = false
user_data = "dGVzdA=="
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
internet_max_bandwidth_out = 10
public_ip_assigned = true
password = "Test@123#"
enhanced_security_service = false
enhanced_monitor_service = false
enhanced_automation_tools_service = false
user_data = "dGVzdA=="

host_name_settings {
host_name = "host-name-test"
Expand Down Expand Up @@ -75,12 +76,13 @@ resource "tencentcloud_as_scaling_config" "example" {

```hcl
resource "tencentcloud_as_scaling_config" "example" {
image_family = "business-daily-update"
configuration_name = "as-test-config"
disk_type_policy = "ORIGINAL"
enhanced_monitor_service = false
enhanced_security_service = false
instance_tags = {}
image_family = "business-daily-update"
configuration_name = "as-test-config"
disk_type_policy = "ORIGINAL"
enhanced_monitor_service = false
enhanced_security_service = false
enhanced_automation_tools_service = false
instance_tags = {}
instance_types = [
"S5.SMALL2",
]
Expand All @@ -106,6 +108,7 @@ The following arguments are supported:
* `cam_role_name` - (Optional, String) CAM role name authorized to access.
* `data_disk` - (Optional, List) Configurations of data disk.
* `disk_type_policy` - (Optional, String) Policy of cloud disk type. Valid values: `ORIGINAL` and `AUTOMATIC`. Default is `ORIGINAL`.
* `enhanced_automation_tools_service` - (Optional, Bool) To specify whether to enable cloud automation tools service. Default is `TRUE`.
* `enhanced_monitor_service` - (Optional, Bool) To specify whether to enable cloud monitor service. Default is `TRUE`.
* `enhanced_security_service` - (Optional, Bool) To specify whether to enable cloud security service. Default is `TRUE`.
* `host_name_settings` - (Optional, List) Related settings of the cloud server hostname (HostName).
Expand Down
Loading