Skip to content

Commit

Permalink
Use IAM role creds in API
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyslav-tk committed Sep 27, 2023
1 parent 3841000 commit 9ac7eb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/src/s3.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use aws_config::ecs::EcsCredentialsProvider;
use aws_sdk_s3::{Client, Config, Credentials, Endpoint, Region};
use hyper::Uri;

/// Configuration for AWS S3 Client
#[derive(clap::Parser)]
pub struct S3 {
/// The S3 AWS access key id
#[clap(env, hide_env_values = true)]
#[clap(env, hide_env_values = true, default_value = "")]
pub aws_access_key_id: String,
/// The S3 AWS secret access key
#[clap(env, hide_env_values = true)]
#[clap(env, hide_env_values = true, default_value = "")]
pub aws_secret_access_key: String,
/// The S3 bucket name
#[clap(env)]
Expand Down Expand Up @@ -47,6 +48,6 @@ impl S3 {
.region(Region::new(self.s3_aws_region.to_owned()))
.load()
.await;
aws_sdk_s3::Client::new(&aws_config)
return Client::new(&aws_config)
}
}

0 comments on commit 9ac7eb1

Please sign in to comment.