Skip to main content

AwsHttpClient

Struct AwsHttpClient 

Source
pub struct AwsHttpClient { /* private fields */ }
Expand description

HTTP client for AWS API operations.

Provides automatic SigV4 signing, retry, and rate limiting.

Implementations§

Source§

impl AwsHttpClient

Source

pub fn builder() -> AwsHttpClientBuilder

Create a new builder.

Source

pub fn from_default_chain(region: &str) -> Result<Self, AwsError>

Create a client from the default credential chain (sync).

Checks environment variables and credentials file. For ECS/IMDS support, use from_default_chain_async.

Source

pub async fn from_default_chain_async(region: &str) -> Result<Self, AwsError>

Create a client from the full async credential chain.

Checks environment variables, credentials file, ECS container credentials, and EC2 instance metadata (IMDSv2) in order.

Source

pub fn region(&self) -> &str

Get the configured region.

Source

pub fn with_region(&self, region: &str) -> Result<Self, AwsError>

Create a new client targeting a different region.

Clones the credentials with the new region and builds a fresh client preserving the same retry and rate-limit configuration. Each regional client gets its own rate limiter — AWS limits are per-account-per-region.

Source

pub fn accessanalyzer(&self) -> AccessAnalyzerClient<'_>

Access the AWS IAM Access Analyzer API

Source

pub fn apigateway(&self) -> ApigatewayClient<'_>

Access the Amazon API Gateway API

Source

pub fn autoscaling(&self) -> AutoScalingClient<'_>

Access the Amazon Auto Scaling API

Source

pub fn ce(&self) -> CeClient<'_>

Access the AWS Cost Explorer API

Source

pub fn cloudfront(&self) -> CloudfrontClient<'_>

Access the Amazon CloudFront API

Source

pub fn cloudtrail(&self) -> CloudtrailClient<'_>

Access the AWS CloudTrail API

Source

pub fn cloudwatch(&self) -> CloudWatchClient<'_>

Access the Amazon CloudWatch API

Source

pub fn config(&self) -> ConfigClient<'_>

Access the AWS Config API

Source

pub fn dynamodb(&self) -> DynamodbClient<'_>

Access the Amazon DynamoDB API

Source

pub fn ec2(&self) -> Ec2Client<'_>

Access the Amazon EC2 API

Source

pub fn ecr(&self) -> EcrClient<'_>

Access the Amazon Elastic Container Registry API

Source

pub fn ecs(&self) -> EcsClient<'_>

Access the Amazon Elastic Container Service API

Source

pub fn efs(&self) -> EfsClient<'_>

Access the Amazon Elastic File System API

Source

pub fn eks(&self) -> EksClient<'_>

Access the Amazon Elastic Kubernetes Service API

Source

pub fn elasticache(&self) -> ElasticacheClient<'_>

Access the Amazon ElastiCache API

Source

pub fn elbv2(&self) -> Elbv2Client<'_>

Access the Elastic Load Balancing v2 API

Source

pub fn emr(&self) -> EmrClient<'_>

Access the Amazon EMR API

Source

pub fn iam(&self) -> IamClient<'_>

Access the AWS Identity and Access Management API

Source

pub fn kinesis(&self) -> KinesisClient<'_>

Access the Amazon Kinesis API

Source

pub fn kms(&self) -> KmsClient<'_>

Access the AWS Key Management Service API

Source

pub fn lambda(&self) -> LambdaClient<'_>

Access the AWS Lambda API

Source

pub fn logs(&self) -> LogsClient<'_>

Access the Amazon CloudWatch Logs API

Source

pub fn opensearch(&self) -> OpensearchClient<'_>

Access the Amazon OpenSearch Service API

Source

pub fn organizations(&self) -> OrganizationsClient<'_>

Access the AWS Organizations API

Source

pub fn rds(&self) -> RdsClient<'_>

Access the Amazon Relational Database Service API

Source

pub fn redshift(&self) -> RedshiftClient<'_>

Access the Amazon Redshift API

Source

pub fn route53(&self) -> Route53Client<'_>

Access the Amazon Route 53 API

Source

pub fn s3(&self) -> S3Client<'_>

Access the Amazon S3 API

Source

pub fn sagemaker(&self) -> SagemakerClient<'_>

Access the Amazon SageMaker API

Source

pub fn secretsmanager(&self) -> SecretsmanagerClient<'_>

Access the AWS Secrets Manager API

Source

pub fn securityhub(&self) -> SecurityHubClient<'_>

Access the AWS Security Hub API

Source

pub fn sts(&self) -> StsClient<'_>

Access the AWS Security Token Service API

Source

pub async fn get( &self, url: &str, service: &str, ) -> Result<AwsResponse, AwsError>

Make a signed GET request with automatic retry.

Source

pub async fn get_json( &self, url: &str, service: &str, ) -> Result<AwsResponse, AwsError>

Make a signed GET request with Accept: application/json.

Used for REST-JSON services (e.g. API Gateway) that return HAL format by default and require Accept: application/json to get plain JSON.

Source

pub async fn post( &self, url: &str, service: &str, body: &[u8], content_type: &str, ) -> Result<AwsResponse, AwsError>

Make a signed POST request with a body.

Source

pub async fn post_json( &self, url: &str, service: &str, target: &str, json_version: &str, body: &[u8], ) -> Result<AwsResponse, AwsError>

Make a signed POST request for AWS JSON protocol services.

Automatically sets Content-Type: application/x-amz-json-{json_version} and X-Amz-Target: {target}, with both headers included in the SigV4 signature.

Source

pub async fn put( &self, url: &str, service: &str, body: &[u8], content_type: &str, ) -> Result<AwsResponse, AwsError>

Make a signed PUT request with a body.

Source

pub async fn delete( &self, url: &str, service: &str, ) -> Result<AwsResponse, AwsError>

Make a signed DELETE request.

Source

pub async fn patch( &self, url: &str, service: &str, body: &[u8], content_type: &str, ) -> Result<AwsResponse, AwsError>

Make a signed PATCH request.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more