Skip to content

Commit eb3e7ec

Browse files
authored
tem application support ins id (#1306)
1 parent 78bc684 commit eb3e7ec

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tencentcloud/resource_tc_tem_application.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {

website/docs/r/tem_application.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The following arguments are supported:
3232
* `application_name` - (Required, String) application name.
3333
* `coding_language` - (Required, String) program language, like JAVA.
3434
* `description` - (Optional, String) application description.
35+
* `instance_id` - (Optional, String) tcr instance id.
3536
* `repo_name` - (Optional, String) repository name.
3637
* `repo_server` - (Optional, String) registry address.
3738
* `repo_type` - (Optional, Int) repo type, 0: tcr personal, 1: tcr enterprise, 2: public repository, 4: demo image.

0 commit comments

Comments
 (0)