You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/09/04 08:43:28 UTC

[GitHub] [incubator-opendal] Xuanwo added a comment to the discussion: S3 service root and region not effective

GitHub user Xuanwo added a comment to the discussion: S3 service root and region not effective

```rust
let mut builder = S3::default();
builder
    .endpoint(endpoint)
    .root(&format!("storage-{}", storage_server_id))
    .bucket(bucket)
    .region(region)
    .access_key_id(access_key_id)
    .secret_access_key(secret_access_key)
    .allow_anonymous()
    .build()?;
Ok(Operator::new(builder)?.finish())
```

Please don't call `builder.build?` directly, it will take and consume `builder` itself. Instead:

```rust
let mut builder = S3::default();
builder
    .endpoint(endpoint)
    .root(&format!("storage-{}", storage_server_id))
    .bucket(bucket)
    .region(region)
    .access_key_id(access_key_id)
    .secret_access_key(secret_access_key)
    .allow_anonymous();
Ok(Operator::new(builder)?.finish())
```

GitHub link: https://github.com/apache/incubator-opendal/discussions/3006#discussioncomment-6902460

----
This is an automatically sent email for commits@opendal.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@opendal.apache.org