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
impl AwsHttpClient
Sourcepub fn builder() -> AwsHttpClientBuilder
pub fn builder() -> AwsHttpClientBuilder
Create a new builder.
Sourcepub fn from_default_chain(region: &str) -> Result<Self, AwsError>
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.
Sourcepub async fn from_default_chain_async(region: &str) -> Result<Self, AwsError>
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.
Sourcepub fn with_region(&self, region: &str) -> Result<Self, AwsError>
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.
Sourcepub fn accessanalyzer(&self) -> AccessAnalyzerClient<'_>
pub fn accessanalyzer(&self) -> AccessAnalyzerClient<'_>
Access the AWS IAM Access Analyzer API
Sourcepub fn apigateway(&self) -> ApigatewayClient<'_>
pub fn apigateway(&self) -> ApigatewayClient<'_>
Access the Amazon API Gateway API
Sourcepub fn autoscaling(&self) -> AutoScalingClient<'_>
pub fn autoscaling(&self) -> AutoScalingClient<'_>
Access the Amazon Auto Scaling API
Sourcepub fn cloudfront(&self) -> CloudfrontClient<'_>
pub fn cloudfront(&self) -> CloudfrontClient<'_>
Access the Amazon CloudFront API
Sourcepub fn cloudtrail(&self) -> CloudtrailClient<'_>
pub fn cloudtrail(&self) -> CloudtrailClient<'_>
Access the AWS CloudTrail API
Sourcepub fn cloudwatch(&self) -> CloudWatchClient<'_>
pub fn cloudwatch(&self) -> CloudWatchClient<'_>
Access the Amazon CloudWatch API
Sourcepub fn config(&self) -> ConfigClient<'_>
pub fn config(&self) -> ConfigClient<'_>
Access the AWS Config API
Sourcepub fn dynamodb(&self) -> DynamodbClient<'_>
pub fn dynamodb(&self) -> DynamodbClient<'_>
Access the Amazon DynamoDB API
Sourcepub fn elasticache(&self) -> ElasticacheClient<'_>
pub fn elasticache(&self) -> ElasticacheClient<'_>
Access the Amazon ElastiCache API
Sourcepub fn elbv2(&self) -> Elbv2Client<'_>
pub fn elbv2(&self) -> Elbv2Client<'_>
Access the Elastic Load Balancing v2 API
Sourcepub fn kinesis(&self) -> KinesisClient<'_>
pub fn kinesis(&self) -> KinesisClient<'_>
Access the Amazon Kinesis API
Sourcepub fn lambda(&self) -> LambdaClient<'_>
pub fn lambda(&self) -> LambdaClient<'_>
Access the AWS Lambda API
Sourcepub fn logs(&self) -> LogsClient<'_>
pub fn logs(&self) -> LogsClient<'_>
Access the Amazon CloudWatch Logs API
Sourcepub fn opensearch(&self) -> OpensearchClient<'_>
pub fn opensearch(&self) -> OpensearchClient<'_>
Access the Amazon OpenSearch Service API
Sourcepub fn organizations(&self) -> OrganizationsClient<'_>
pub fn organizations(&self) -> OrganizationsClient<'_>
Access the AWS Organizations API
Sourcepub fn redshift(&self) -> RedshiftClient<'_>
pub fn redshift(&self) -> RedshiftClient<'_>
Access the Amazon Redshift API
Sourcepub fn route53(&self) -> Route53Client<'_>
pub fn route53(&self) -> Route53Client<'_>
Access the Amazon Route 53 API
Sourcepub fn sagemaker(&self) -> SagemakerClient<'_>
pub fn sagemaker(&self) -> SagemakerClient<'_>
Access the Amazon SageMaker API
Sourcepub fn secretsmanager(&self) -> SecretsmanagerClient<'_>
pub fn secretsmanager(&self) -> SecretsmanagerClient<'_>
Access the AWS Secrets Manager API
Sourcepub fn securityhub(&self) -> SecurityHubClient<'_>
pub fn securityhub(&self) -> SecurityHubClient<'_>
Access the AWS Security Hub API
Sourcepub async fn get(
&self,
url: &str,
service: &str,
) -> Result<AwsResponse, AwsError>
pub async fn get( &self, url: &str, service: &str, ) -> Result<AwsResponse, AwsError>
Make a signed GET request with automatic retry.
Sourcepub async fn get_json(
&self,
url: &str,
service: &str,
) -> Result<AwsResponse, AwsError>
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.
Sourcepub async fn post(
&self,
url: &str,
service: &str,
body: &[u8],
content_type: &str,
) -> Result<AwsResponse, AwsError>
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.
Sourcepub async fn post_json(
&self,
url: &str,
service: &str,
target: &str,
json_version: &str,
body: &[u8],
) -> Result<AwsResponse, AwsError>
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.
Sourcepub async fn put(
&self,
url: &str,
service: &str,
body: &[u8],
content_type: &str,
) -> Result<AwsResponse, AwsError>
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.