File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
internal/backend/remote-state/cos Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ func New() backend.Backend {
113113 return nil , nil
114114 },
115115 },
116+ "accelerate" : {
117+ Type : schema .TypeBool ,
118+ Optional : true ,
119+ Description : "Whether to enable global Acceleration" ,
120+ Default : false ,
121+ },
116122 },
117123 }
118124
@@ -138,7 +144,16 @@ func (b *Backend) configure(ctx context.Context) error {
138144 b .encrypt = data .Get ("encrypt" ).(bool )
139145 b .acl = data .Get ("acl" ).(string )
140146
141- u , err := url .Parse (fmt .Sprintf ("https://%s.cos.%s.myqcloud.com" , b .bucket , b .region ))
147+ var (
148+ u * url.URL
149+ err error
150+ )
151+ accelerate := data .Get ("accelerate" ).(bool )
152+ if accelerate {
153+ u , err = url .Parse (fmt .Sprintf ("https://%s.cos.accelerate.myqcloud.com" , b .bucket ))
154+ } else {
155+ u , err = url .Parse (fmt .Sprintf ("https://%s.cos.%s.myqcloud.com" , b .bucket , b .region ))
156+ }
142157 if err != nil {
143158 return err
144159 }
You can’t perform that action at this time.
0 commit comments