@@ -5,7 +5,8 @@ Example Usage
55
66```hcl
77resource "tencentcloud_dlc_store_location_config" "store_location_config" {
8- store_location = "cosn://cos-xxxxx-xxx/test/"
8+ store_location = "cosn://bucketname/"
9+ enable = 1
910}
1011```
1112
@@ -42,7 +43,13 @@ func resourceTencentCloudDlcStoreLocationConfig() *schema.Resource {
4243 "store_location" : {
4344 Required : true ,
4445 Type : schema .TypeString ,
45- Description : "Calculate the results of the COS path, such as: cosn: // bucketName/." ,
46+ Description : "The calculation results are stored in the cos path, such as: cosn://bucketname/." ,
47+ },
48+
49+ "enable" : {
50+ Required : true ,
51+ Type : schema .TypeInt ,
52+ Description : "Whether to enable advanced settings: 0-no, 1-yes." ,
4653 },
4754 },
4855 }
@@ -65,9 +72,7 @@ func resourceTencentCloudDlcStoreLocationConfigRead(d *schema.ResourceData, meta
6572
6673 service := DlcService {client : meta .(* TencentCloudClient ).apiV3Conn }
6774
68- storeLocationConfigId := d .Id ()
69-
70- storeLocationConfig , err := service .DescribeDlcStoreLocationConfigById (ctx , storeLocationConfigId )
75+ storeLocationConfig , err := service .DescribeDlcStoreLocationConfigById (ctx )
7176 if err != nil {
7277 return err
7378 }
@@ -82,6 +87,9 @@ func resourceTencentCloudDlcStoreLocationConfigRead(d *schema.ResourceData, meta
8287 _ = d .Set ("store_location" , storeLocationConfig .StoreLocation )
8388 }
8489
90+ if storeLocationConfig .Enable != nil {
91+ _ = d .Set ("enable" , storeLocationConfig .Enable )
92+ }
8593 return nil
8694}
8795
@@ -91,18 +99,20 @@ func resourceTencentCloudDlcStoreLocationConfigUpdate(d *schema.ResourceData, me
9199
92100 logId := getLogId (contextNil )
93101
94- request := dlc .NewCreateStoreLocationRequest ()
102+ request := dlc .NewModifyAdvancedStoreLocationRequest ()
95103
96- var (
97- storeLocationId string
98- )
104+ var storeLocation string
99105 if v , ok := d .GetOk ("store_location" ); ok {
100- storeLocationId = v .(string )
106+ storeLocation = v .(string )
101107 request .StoreLocation = helper .String (v .(string ))
102108 }
103109
110+ if v , ok := d .GetOkExists ("enable" ); ok {
111+ request .Enable = helper .IntUint64 (v .(int ))
112+ }
113+
104114 err := resource .Retry (writeRetryTimeout , func () * resource.RetryError {
105- result , e := meta .(* TencentCloudClient ).apiV3Conn .UseDlcClient ().CreateStoreLocation (request )
115+ result , e := meta .(* TencentCloudClient ).apiV3Conn .UseDlcClient ().ModifyAdvancedStoreLocation (request )
106116 if e != nil {
107117 return retryError (e )
108118 } else {
@@ -115,8 +125,7 @@ func resourceTencentCloudDlcStoreLocationConfigUpdate(d *schema.ResourceData, me
115125 return err
116126 }
117127
118- d .SetId (storeLocationId )
119-
128+ d .SetId (storeLocation )
120129 return resourceTencentCloudDlcStoreLocationConfigRead (d , meta )
121130}
122131
0 commit comments