Using S3 Express One Zone from the Rust SDK #1091
ysaito1001
announced in
Change Log
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This guide describes making use of S3 Express One Zone from the Rust SDK. For more details on S3 Express One Zone, see this documentation.
Interacting with S3 Express One Zone buckets
You can use the Rust SDK to interact with S3 Express One Zone buckets ("S3 Express bucket" for short for the remaining of this guide) much the same way you do with regular S3 buckets.
To start, you can create an S3 Express bucket as follows:
Assuming your default region is
us-west-2
, the code above will create an S3 Express bucket with the names3express-example-bucket--usw2-az1--x-s3
as a directory bucket.You can then call S3 APIs with S3 Express One Zone just as you do with regular S3 buckets. Make sure to specify the name of an S3 Express bucket. For instance:
Overriding a credentials provider for S3 Express One Zone
S3 Express One Zone internally uses a default-implemented credentials provider. You can override it with your own custom credentials provider for S3 Express One Zone, calling
.express_credentials_provider
on an S3 client. The method can be called either at a client level or at an operation level.Overriding an S3 Express credentials provider at a client level:
Overriding an S3 Express credentials provider at an operation level:
Keep in mind that when overriding an S3 Express credentials provider, the default caching implementation for S3 Express credentials is no longer available. Thus, you need to provide you own caching for S3 Express credentials internal to a custom S3 Express credentials provider.
Disabling S3 Express One Zone
S3 Express One Zone has its own auth session flow that uses a modified SigV4 and it is enabled by default. You can disable S3 Express One Zone with one of the following ways:
highest precedence
s3_disable_express_session_auth
on an S3 client config (either at a client level or at an operation level)AWS_S3_DISABLE_EXPRESS_SESSION_AUTH
(accepting case-insensitive "true" or "false", and ignoring any other values)s3_disable_express_session_auth
in the config file at~/.aws/config
lowest precedence
If one of the places is set to true/false, subsequent places with lower precedence will not be considered.
Something to be aware of when setting the disable option through the environment variable. The environment variable is only checked during a client construction, meaning that if a customer sets it after the client has been created the SDK will not take the environment variable value into account, i.e. the following snippet will NOT disable the S3 Express session auth:
Beta Was this translation helpful? Give feedback.
All reactions