@@ -157,12 +157,14 @@ func TencentMsyqlBasicInfo() map[string]*schema.Schema {
157157 "vpc_id" : {
158158 Type : schema .TypeString ,
159159 Optional : true ,
160+ Computed : true ,
160161 ValidateFunc : validateStringLengthInRange (1 , 100 ),
161162 Description : "ID of VPC, which can be modified once every 24 hours and can't be removed." ,
162163 },
163164 "subnet_id" : {
164165 Type : schema .TypeString ,
165166 Optional : true ,
167+ Computed : true ,
166168 ValidateFunc : validateStringLengthInRange (1 , 100 ),
167169 Description : "Private network ID. If `vpc_id` is set, this value is required." ,
168170 },
@@ -798,12 +800,8 @@ func tencentMsyqlBasicInfoRead(ctx context.Context, d *schema.ResourceData, meta
798800 _ = d .Set ("mem_size" , mysqlInfo .Memory )
799801 _ = d .Set ("cpu" , mysqlInfo .Cpu )
800802 _ = d .Set ("volume_size" , mysqlInfo .Volume )
801- if d .Get ("vpc_id" ).(string ) != "" {
802- errRet = d .Set ("vpc_id" , mysqlInfo .UniqVpcId )
803- }
804- if d .Get ("subnet_id" ).(string ) != "" {
805- errRet = d .Set ("subnet_id" , mysqlInfo .UniqSubnetId )
806- }
803+ _ = d .Set ("vpc_id" , mysqlInfo .UniqVpcId )
804+ _ = d .Set ("subnet_id" , mysqlInfo .UniqSubnetId )
807805
808806 isUniversal := mysqlInfo .DeviceType != nil && * mysqlInfo .DeviceType == "UNIVERSAL"
809807 if _ , ok := d .GetOk ("device_type" ); ok || ! isUniversal {
0 commit comments