Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tencentcloud/resource_tc_tem_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ func resourceTencentCloudTemApplication() *schema.Resource {
Optional: true,
Description: "repository name.",
},

"instance_id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "tcr instance id.",
},
},
}
}
Expand Down Expand Up @@ -127,6 +134,10 @@ func resourceTencentCloudTemApplicationCreate(d *schema.ResourceData, meta inter
request.RepoName = helper.String(v.(string))
}

if v, ok := d.GetOk("instance_id"); ok {
request.InstanceId = helper.String(v.(string))
}

request.DeployMode = helper.String("IMAGE")

err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
Expand Down Expand Up @@ -200,6 +211,10 @@ func resourceTencentCloudTemApplicationRead(d *schema.ResourceData, meta interfa
_ = d.Set("repo_name", application.RepoName)
}

if application.InstanceId != nil {
_ = d.Set("instance_id", application.InstanceId)
}

return nil
}

Expand Down Expand Up @@ -243,6 +258,10 @@ func resourceTencentCloudTemApplicationUpdate(d *schema.ResourceData, meta inter
return fmt.Errorf("`repo_name` do not support change now.")
}

if d.HasChange("instance_id") {
return fmt.Errorf("`instance_id` do not support change now.")
}

err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
result, e := meta.(*TencentCloudClient).apiV3Conn.UseTemClient().ModifyApplicationInfo(request)
if e != nil {
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/tem_application.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The following arguments are supported:
* `application_name` - (Required, String) application name.
* `coding_language` - (Required, String) program language, like JAVA.
* `description` - (Optional, String) application description.
* `instance_id` - (Optional, String) tcr instance id.
* `repo_name` - (Optional, String) repository name.
* `repo_server` - (Optional, String) registry address.
* `repo_type` - (Optional, Int) repo type, 0: tcr personal, 1: tcr enterprise, 2: public repository, 4: demo image.
Expand Down