@@ -1521,6 +1521,43 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
15211521 },
15221522 },
15231523 },
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+ },
15241561 "tags" : {
15251562 Type : schema .TypeMap ,
15261563 Optional : true ,
@@ -2389,6 +2426,24 @@ func resourceTencentCloudCdnDomainCreate(d *schema.ResourceData, meta interface{
23892426 request .QnPrivateAccess .SecretKey = & v
23902427 }
23912428 }
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+ }
23922447
23932448 if v := d .Get ("explicit_using_dry_run" ).(bool ); v {
23942449 d .SetId (domain )
@@ -3027,6 +3082,15 @@ func resourceTencentCloudCdnDomainRead(d *schema.ResourceData, meta interface{})
30273082 "secret_key" : dc .QnPrivateAccess .SecretKey ,
30283083 })
30293084 }
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+ }
30303094
30313095 tags , errRet := tagService .DescribeResourceTags (ctx , CDN_SERVICE_NAME , CDN_RESOURCE_NAME_DOMAIN , region , domain )
30323096 if errRet != nil {
@@ -3883,6 +3947,24 @@ func resourceTencentCloudCdnDomainUpdate(d *schema.ResourceData, meta interface{
38833947 request .QnPrivateAccess .SecretKey = & v
38843948 }
38853949 }
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+ }
38863968
38873969 if v := d .Get ("explicit_using_dry_run" ).(bool ); v {
38883970 _ = d .Set ("dry_run_update_result" , request .ToJsonString ())
0 commit comments