@@ -1521,6 +1521,43 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
1521
1521
},
1522
1522
},
1523
1523
},
1524
+ "others_private_access" : {
1525
+ Type : schema .TypeList ,
1526
+ MaxItems : 1 ,
1527
+ Optional : true ,
1528
+ Description : "Object storage back-to-source authentication of other vendors." ,
1529
+ Elem : & schema.Resource {
1530
+ Schema : map [string ]* schema.Schema {
1531
+ "switch" : {
1532
+ Type : schema .TypeString ,
1533
+ Required : true ,
1534
+ Description : "Configuration switch, available values: `on`, `off` (default)." ,
1535
+ },
1536
+ "access_key" : {
1537
+ Type : schema .TypeString ,
1538
+ Optional : true ,
1539
+ Description : "Access ID." ,
1540
+ Sensitive : true ,
1541
+ },
1542
+ "secret_key" : {
1543
+ Type : schema .TypeString ,
1544
+ Optional : true ,
1545
+ Description : "Key." ,
1546
+ Sensitive : true ,
1547
+ },
1548
+ "region" : {
1549
+ Type : schema .TypeString ,
1550
+ Optional : true ,
1551
+ Description : "Region." ,
1552
+ },
1553
+ "bucket" : {
1554
+ Type : schema .TypeString ,
1555
+ Optional : true ,
1556
+ Description : "Bucket." ,
1557
+ },
1558
+ },
1559
+ },
1560
+ },
1524
1561
"tags" : {
1525
1562
Type : schema .TypeMap ,
1526
1563
Optional : true ,
@@ -2389,6 +2426,24 @@ func resourceTencentCloudCdnDomainCreate(d *schema.ResourceData, meta interface{
2389
2426
request .QnPrivateAccess .SecretKey = & v
2390
2427
}
2391
2428
}
2429
+ if v , ok := helper .InterfacesHeadMap (d , "others_private_access" ); ok {
2430
+ vSwitch := v ["switch" ].(string )
2431
+ request .OthersPrivateAccess = & cdn.OthersPrivateAccess {
2432
+ Switch : & vSwitch ,
2433
+ }
2434
+ if v , ok := v ["access_key" ].(string ); ok && v != "" {
2435
+ request .OthersPrivateAccess .AccessKey = & v
2436
+ }
2437
+ if v , ok := v ["secret_key" ].(string ); ok && v != "" {
2438
+ request .OthersPrivateAccess .SecretKey = & v
2439
+ }
2440
+ if v , ok := v ["region" ].(string ); ok && v != "" {
2441
+ request .OthersPrivateAccess .Region = & v
2442
+ }
2443
+ if v , ok := v ["bucket" ].(string ); ok && v != "" {
2444
+ request .OthersPrivateAccess .Bucket = & v
2445
+ }
2446
+ }
2392
2447
2393
2448
if v := d .Get ("explicit_using_dry_run" ).(bool ); v {
2394
2449
d .SetId (domain )
@@ -3027,6 +3082,15 @@ func resourceTencentCloudCdnDomainRead(d *schema.ResourceData, meta interface{})
3027
3082
"secret_key" : dc .QnPrivateAccess .SecretKey ,
3028
3083
})
3029
3084
}
3085
+ if ok := checkCdnInfoWritable (d , "others_private_access" , dc .OthersPrivateAccess ); ok {
3086
+ _ = helper .SetMapInterfaces (d , "others_private_access" , map [string ]interface {}{
3087
+ "switch" : dc .OthersPrivateAccess .Switch ,
3088
+ "access_key" : dc .OthersPrivateAccess .AccessKey ,
3089
+ "secret_key" : dc .OthersPrivateAccess .SecretKey ,
3090
+ "bucket" : dc .OthersPrivateAccess .Bucket ,
3091
+ "region" : dc .OthersPrivateAccess .Region ,
3092
+ })
3093
+ }
3030
3094
3031
3095
tags , errRet := tagService .DescribeResourceTags (ctx , CDN_SERVICE_NAME , CDN_RESOURCE_NAME_DOMAIN , region , domain )
3032
3096
if errRet != nil {
@@ -3883,6 +3947,24 @@ func resourceTencentCloudCdnDomainUpdate(d *schema.ResourceData, meta interface{
3883
3947
request .QnPrivateAccess .SecretKey = & v
3884
3948
}
3885
3949
}
3950
+ if v , ok , hasChanged := checkCdnHeadMapOkAndChanged (d , "others_private_access" ); ok && hasChanged {
3951
+ vSwitch := v ["switch" ].(string )
3952
+ request .OthersPrivateAccess = & cdn.OthersPrivateAccess {
3953
+ Switch : & vSwitch ,
3954
+ }
3955
+ if v , ok := v ["access_key" ].(string ); ok && v != "" {
3956
+ request .OthersPrivateAccess .AccessKey = & v
3957
+ }
3958
+ if v , ok := v ["secret_key" ].(string ); ok && v != "" {
3959
+ request .OthersPrivateAccess .SecretKey = & v
3960
+ }
3961
+ if v , ok := v ["region" ].(string ); ok && v != "" {
3962
+ request .OthersPrivateAccess .Region = & v
3963
+ }
3964
+ if v , ok := v ["bucket" ].(string ); ok && v != "" {
3965
+ request .OthersPrivateAccess .Bucket = & v
3966
+ }
3967
+ }
3886
3968
3887
3969
if v := d .Get ("explicit_using_dry_run" ).(bool ); v {
3888
3970
_ = d .Set ("dry_run_update_result" , request .ToJsonString ())
0 commit comments