@@ -86,6 +86,13 @@ func resourceTencentCloudTemApplication() *schema.Resource {
8686 Optional : true ,
8787 Description : "repository name." ,
8888 },
89+
90+ "instance_id" : {
91+ Type : schema .TypeString ,
92+ Optional : true ,
93+ Computed : true ,
94+ Description : "tcr instance id." ,
95+ },
8996 },
9097 }
9198}
@@ -127,6 +134,10 @@ func resourceTencentCloudTemApplicationCreate(d *schema.ResourceData, meta inter
127134 request .RepoName = helper .String (v .(string ))
128135 }
129136
137+ if v , ok := d .GetOk ("instance_id" ); ok {
138+ request .InstanceId = helper .String (v .(string ))
139+ }
140+
130141 request .DeployMode = helper .String ("IMAGE" )
131142
132143 err := resource .Retry (writeRetryTimeout , func () * resource.RetryError {
@@ -200,6 +211,10 @@ func resourceTencentCloudTemApplicationRead(d *schema.ResourceData, meta interfa
200211 _ = d .Set ("repo_name" , application .RepoName )
201212 }
202213
214+ if application .InstanceId != nil {
215+ _ = d .Set ("instance_id" , application .InstanceId )
216+ }
217+
203218 return nil
204219}
205220
@@ -243,6 +258,10 @@ func resourceTencentCloudTemApplicationUpdate(d *schema.ResourceData, meta inter
243258 return fmt .Errorf ("`repo_name` do not support change now." )
244259 }
245260
261+ if d .HasChange ("instance_id" ) {
262+ return fmt .Errorf ("`instance_id` do not support change now." )
263+ }
264+
246265 err := resource .Retry (writeRetryTimeout , func () * resource.RetryError {
247266 result , e := meta .(* TencentCloudClient ).apiV3Conn .UseTemClient ().ModifyApplicationInfo (request )
248267 if e != nil {
0 commit comments