@@ -99,7 +99,7 @@ func ResourceTencentCloudCvmLaunchTemplate() *schema.Resource {
99
99
},
100
100
"disk_id" : {
101
101
Type : schema .TypeString ,
102
- Optional : true ,
102
+ Computed : true ,
103
103
Description : "System disk ID." ,
104
104
},
105
105
"disk_size" : {
@@ -135,7 +135,7 @@ func ResourceTencentCloudCvmLaunchTemplate() *schema.Resource {
135
135
},
136
136
"disk_id" : {
137
137
Type : schema .TypeString ,
138
- Optional : true ,
138
+ Computed : true ,
139
139
Description : "Data disk ID." ,
140
140
},
141
141
"delete_with_instance" : {
@@ -665,9 +665,6 @@ func resourceTencentCloudCvmLaunchTemplateCreate(d *schema.ResourceData, meta in
665
665
if v , ok := dMap ["disk_type" ]; ok {
666
666
systemDisk .DiskType = helper .String (v .(string ))
667
667
}
668
- if v , ok := dMap ["disk_id" ]; ok {
669
- systemDisk .DiskId = helper .String (v .(string ))
670
- }
671
668
if v , ok := dMap ["disk_size" ]; ok {
672
669
systemDisk .DiskSize = helper .IntInt64 (v .(int ))
673
670
}
@@ -687,9 +684,6 @@ func resourceTencentCloudCvmLaunchTemplateCreate(d *schema.ResourceData, meta in
687
684
if v , ok := dMap ["disk_type" ]; ok {
688
685
dataDisk .DiskType = helper .String (v .(string ))
689
686
}
690
- if v , ok := dMap ["disk_id" ]; ok {
691
- dataDisk .DiskId = helper .String (v .(string ))
692
- }
693
687
if v , ok := dMap ["delete_with_instance" ]; ok {
694
688
dataDisk .DeleteWithInstance = helper .Bool (v .(bool ))
695
689
}
@@ -763,8 +757,8 @@ func resourceTencentCloudCvmLaunchTemplateCreate(d *schema.ResourceData, meta in
763
757
764
758
if dMap , ok := helper .InterfacesHeadMap (d , "login_settings" ); ok {
765
759
loginSettings := cvm.LoginSettings {}
766
- if v , ok := dMap ["password" ]; ok {
767
- loginSettings .Password = helper .String (v .( string ) )
760
+ if v , ok := dMap ["password" ].( string ) ; ok && v != "" {
761
+ loginSettings .Password = helper .String (v )
768
762
}
769
763
if v , ok := dMap ["key_ids" ]; ok {
770
764
keyIdsSet := v .(* schema.Set ).List ()
@@ -773,8 +767,8 @@ func resourceTencentCloudCvmLaunchTemplateCreate(d *schema.ResourceData, meta in
773
767
loginSettings .KeyIds = append (loginSettings .KeyIds , & keyIds )
774
768
}
775
769
}
776
- if v , ok := dMap ["keep_image_login" ]; ok {
777
- loginSettings .KeepImageLogin = helper .String (v .( string ) )
770
+ if v , ok := dMap ["keep_image_login" ].( string ) ; ok && v != "" {
771
+ loginSettings .KeepImageLogin = helper .String (v )
778
772
}
779
773
request .LoginSettings = & loginSettings
780
774
}
0 commit comments