File tree Expand file tree Collapse file tree
libsql-wal/src/storage/backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use std::fmt;
44use std:: mem:: size_of;
55use std:: path:: Path ;
66use std:: pin:: Pin ;
7+ use std:: str:: FromStr ;
78use std:: sync:: Arc ;
89use std:: task:: Poll ;
910
@@ -68,6 +69,9 @@ impl<IO: Io> S3Backend<IO> {
6869 . to_builder ( )
6970 . force_path_style ( true )
7071 . build ( ) ;
72+
73+ let region = config. region ( ) . expect ( "region must be configured" ) . clone ( ) ;
74+
7175 let client = Client :: from_conf ( config) ;
7276 let config = S3Config {
7377 bucket,
@@ -76,8 +80,9 @@ impl<IO: Io> S3Backend<IO> {
7680 } ;
7781
7882 let bucket_config = CreateBucketConfiguration :: builder ( )
79- // TODO: get location from config
80- . location_constraint ( aws_sdk_s3:: types:: BucketLocationConstraint :: UsWest2 )
83+ . location_constraint (
84+ aws_sdk_s3:: types:: BucketLocationConstraint :: from_str ( & region. to_string ( ) ) . unwrap ( ) ,
85+ )
8186 . build ( ) ;
8287
8388 // TODO: we may need to create the bucket for config overrides. Maybe try lazy bucket
You can’t perform that action at this time.
0 commit comments