@@ -93,7 +93,7 @@ func resourceTencentCloudAsScalingConfig() *schema.Resource {
9393 Optional : true ,
9494 Default : SYSTEM_DISK_TYPE_CLOUD_PREMIUM ,
9595 ValidateFunc : validateAllowedStringValue (SYSTEM_DISK_ALLOW_TYPE ),
96- Description : "Type of a CVM disk. Valid values: `CLOUD_PREMIUM` and `CLOUD_SSD`. Default is `CLOUD_PREMIUM`." ,
96+ Description : "Type of a CVM disk. Valid values: `CLOUD_PREMIUM` and `CLOUD_SSD`. Default is `CLOUD_PREMIUM`. valid when disk_type_policy is ORIGINAL. " ,
9797 },
9898 "system_disk_size" : {
9999 Type : schema .TypeInt ,
@@ -114,7 +114,7 @@ func resourceTencentCloudAsScalingConfig() *schema.Resource {
114114 Optional : true ,
115115 Default : SYSTEM_DISK_TYPE_CLOUD_PREMIUM ,
116116 ValidateFunc : validateAllowedStringValue (SYSTEM_DISK_ALLOW_TYPE ),
117- Description : "Types of disk. Valid values: `CLOUD_PREMIUM` and `CLOUD_SSD`." ,
117+ Description : "Types of disk. Valid values: `CLOUD_PREMIUM` and `CLOUD_SSD`. valid when disk_type_policy is ORIGINAL. " ,
118118 },
119119 "disk_size" : {
120120 Type : schema .TypeInt ,
@@ -197,6 +197,13 @@ func resourceTencentCloudAsScalingConfig() *schema.Resource {
197197 Optional : true ,
198198 Description : "A list of tags used to associate different resources." ,
199199 },
200+ "disk_type_policy" : {
201+ Type : schema .TypeString ,
202+ Optional : true ,
203+ Default : SCALING_DISK_TYPE_POLICY_ORIGINAL ,
204+ ValidateFunc : validateAllowedStringValue (SCALING_DISK_TYPE_ALLOW_POLICY ),
205+ Description : "Policy of cloud disk type. Valid values: `ORIGINAL` and `AUTOMATIC`. Default is `ORIGINAL`." ,
206+ },
200207
201208 // Computed values
202209 "status" : {
@@ -343,6 +350,10 @@ func resourceTencentCloudAsScalingConfigCreate(d *schema.ResourceData, meta inte
343350 }
344351 }
345352
353+ if v , ok := d .GetOk ("disk_type_policy" ); ok {
354+ request .DiskTypePolicy = helper .String (v .(string ))
355+ }
356+
346357 response , err := meta .(* TencentCloudClient ).apiV3Conn .UseAsClient ().CreateLaunchConfiguration (request )
347358 if err != nil {
348359 log .Printf ("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n " ,
@@ -385,7 +396,6 @@ func resourceTencentCloudAsScalingConfigRead(d *schema.ResourceData, meta interf
385396 _ = d .Set ("image_id" , * config .ImageId )
386397 _ = d .Set ("project_id" , * config .ProjectId )
387398 _ = d .Set ("instance_types" , helper .StringsInterfaces (config .InstanceTypes ))
388- _ = d .Set ("system_disk_type" , * config .SystemDisk .DiskType )
389399 _ = d .Set ("system_disk_size" , * config .SystemDisk .DiskSize )
390400 _ = d .Set ("data_disk" , flattenDataDiskMappings (config .DataDisks ))
391401 _ = d .Set ("internet_charge_type" , * config .InternetAccessible .InternetChargeType )
@@ -397,6 +407,10 @@ func resourceTencentCloudAsScalingConfigRead(d *schema.ResourceData, meta interf
397407 _ = d .Set ("enhanced_monitor_service" , * config .EnhancedService .MonitorService .Enabled )
398408 _ = d .Set ("user_data" , helper .PString (config .UserData ))
399409 _ = d .Set ("instance_tags" , flattenInstanceTagsMapping (config .InstanceTags ))
410+ _ = d .Set ("disk_type_policy" , * config .DiskTypePolicy )
411+ if config .SystemDisk .DiskType != nil {
412+ _ = d .Set ("system_disk_type" , * config .SystemDisk .DiskType )
413+ }
400414 return nil
401415 })
402416 if err != nil {
@@ -539,6 +553,10 @@ func resourceTencentCloudAsScalingConfigUpdate(d *schema.ResourceData, meta inte
539553 }
540554 }
541555
556+ if v , ok := d .GetOk ("disk_type_policy" ); ok {
557+ request .DiskTypePolicy = helper .String (v .(string ))
558+ }
559+
542560 response , err := meta .(* TencentCloudClient ).apiV3Conn .UseAsClient ().UpgradeLaunchConfiguration (request )
543561 if err != nil {
544562 log .Printf ("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n " ,
0 commit comments