@@ -55,6 +55,18 @@ func ResourceTencentCloudApmInstance() *schema.Resource {
5555 Description : "Modify the billing mode: `1` means prepaid, `0` means pay-as-you-go, the default value is `0`." ,
5656 },
5757
58+ "token" : {
59+ Computed : true ,
60+ Type : schema .TypeString ,
61+ Description : "Business system authentication token." ,
62+ },
63+
64+ "public_collector_url" : {
65+ Computed : true ,
66+ Type : schema .TypeString ,
67+ Description : "External Network Reporting Address." ,
68+ },
69+
5870 "tags" : {
5971 Type : schema .TypeMap ,
6072 Optional : true ,
@@ -180,6 +192,25 @@ func resourceTencentCloudApmInstanceRead(d *schema.ResourceData, meta interface{
180192 _ = d .Set ("pay_mode" , instance .PayMode )
181193 }
182194
195+ if instance .Token != nil {
196+ _ = d .Set ("token" , instance .Token )
197+ }
198+
199+ apmAgent := & apm.ApmAgentInfo {}
200+ err = resource .Retry (tccommon .ReadRetryTimeout , func () * resource.RetryError {
201+ result , err := service .DescribeApmAgentById (ctx , instanceId )
202+ if err != nil {
203+ return tccommon .RetryError (err )
204+ }
205+ apmAgent = result
206+ return nil
207+ })
208+ if err == nil {
209+ if apmAgent .PublicCollectorURL != nil {
210+ _ = d .Set ("public_collector_url" , apmAgent .PublicCollectorURL )
211+ }
212+ }
213+
183214 tcClient := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ()
184215 tagService := svctag .NewTagService (tcClient )
185216 tags , err := tagService .DescribeResourceTags (ctx , "apm" , "apm-instance" , tcClient .Region , d .Id ())
0 commit comments