How to force using http instead of https for s3 express operation? #1195
-
How can I modify the following code to force http? use aws_config::BehaviorVersion;
use aws_sdk_s3::types::{
BucketInfo, BucketType, CreateBucketConfiguration, DataRedundancy, LocationInfo, LocationType,
};
use aws_sdk_s3::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let sdk_config = aws_config::load_defaults(BehaviorVersion::latest()).await;
let client = Client::new(&sdk_config);
let bucket_cfg = CreateBucketConfiguration::builder()
.location(
LocationInfo::builder()
.name("usw2-az1")
.r#type(LocationType::AvailabilityZone)
.build(),
)
.bucket(
BucketInfo::builder()
.data_redundancy(DataRedundancy::SingleAvailabilityZone)
.r#type(BucketType::Directory)
.build(),
)
.build();
// This name is just for an example purpose, use your own express bucket name
let express_bucket = "s3express-example-bucket--usw2-az1--x-s3";
let _ = client
.create_bucket()
.create_bucket_configuration(bucket_cfg)
.bucket(express_bucket)
.send()
.await
.expect("should create a directory bucket");
// --snip--
Ok(())
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
-
I have tried hitting an S3 express endpoint using AWS CLI to see if using HTTP is even supported. With HTTPS
it works. However with HTTP
the command never comes back. This leads me to believe use of HTTP with respect to S3 Express One Zone buckets is not supported. With that being said, what's your use case of forcing HTTP for S3 Express One Zone? |
Beta Was this translation helpful? Give feedback.
I have tried hitting an S3 express endpoint using AWS CLI to see if using HTTP is even supported.
With HTTPS
it works. However with HTTP
the command never comes back.
This leads me to believe use of HTTP with respect to S3 Express One Zone buckets is not supported. With that being said, what's your use case of forcing HTTP for S3 Express One Zone?