Skip to content

Commit 7b9048b

Browse files
authored
fix: add agent_id (#1295)
Co-authored-by: arunma <arunma@tencent.com>
1 parent 304c8fc commit 7b9048b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

tencentcloud/resource_tc_monitor_tmp_cvm_agent.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Import
1414
1515
monitor tmpCvmAgent can be imported using the id, e.g.
1616
```
17-
$ terraform import tencentcloud_monitor_tmp_cvm_agent.tmpCvmAgent tmpCvmAgent_id
17+
$ terraform import tencentcloud_monitor_tmp_cvm_agent.tmpCvmAgent instance_id#agent_id
1818
```
1919
*/
2020
package tencentcloud
@@ -54,6 +54,12 @@ func resourceTencentCloudMonitorTmpCvmAgent() *schema.Resource {
5454
ForceNew: true,
5555
Description: "Agent name.",
5656
},
57+
58+
"agent_id": {
59+
Type: schema.TypeString,
60+
Computed: true,
61+
Description: "Agent id.",
62+
},
5763
},
5864
}
5965
}
@@ -136,6 +142,10 @@ func resourceTencentCloudMonitorTmpCvmAgentRead(d *schema.ResourceData, meta int
136142
_ = d.Set("name", tmpCvmAgent.Name)
137143
}
138144

145+
if tmpCvmAgent.AgentId != nil {
146+
_ = d.Set("agent_id", tmpCvmAgent.AgentId)
147+
}
148+
139149
return nil
140150
}
141151

website/docs/r/monitor_tmp_cvm_agent.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ The following arguments are supported:
3232
In addition to all arguments above, the following attributes are exported:
3333

3434
* `id` - ID of the resource.
35-
35+
* `agent_id` - Agent id.
3636

3737

3838
## Import
3939

4040
monitor tmpCvmAgent can be imported using the id, e.g.
4141
```
42-
$ terraform import tencentcloud_monitor_tmp_cvm_agent.tmpCvmAgent tmpCvmAgent_id
42+
$ terraform import tencentcloud_monitor_tmp_cvm_agent.tmpCvmAgent instance_id#agent_id
4343
```
4444

0 commit comments

Comments
 (0)