### Initialize SSM Quick Setup Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/ssmquicksetup/README.md
Initialize the SSM Quick Setup client using configuration loaded from environment variables. This client is used to make calls to the SSM Quick Setup service.
```rust
use aws_sdk_ssmquicksetup as ssmquicksetup;
#[::tokio::main] async fn main() -> Result<(), ssmquicksetup::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_ssmquicksetup::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### List DynamoDB Tables
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/README.md
This example demonstrates how to initialize the SDK client and list the first 10 DynamoDB tables in your account.
```rust
use aws_sdk_dynamodb::{Client, Error};
#[tokio::main] async fn main() -> Result<(), Error> {
let shared_config = aws_config::load_from_env().await;
let client = Client::new(&shared_config);
let req = client.list_tables().limit(10);
let resp = req.send().await?;
println!("Current DynamoDB tables: {:?}", resp.table_names);
Ok(())
}
```
--------------------------------
### Initialize Kendra Ranking Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/kendraranking/README.md
Create a Kendra Ranking client by loading configuration from the environment and initializing the client. This example requires Tokio for asynchronous execution.
```rust
use aws_sdk_kendraranking as kendraranking;
#[::tokio::main]
async fn main() -> Result<(), kendraranking::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_kendraranking::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize Q Connect Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/qconnect/README.md
Load AWS configuration from environment variables and create a Q Connect client instance to interact with the service. This example requires Tokio for asynchronous execution.
```rust
use aws_sdk_qconnect as qconnect;
#[::tokio::main]
async fn main() -> Result<(), qconnect::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_qconnect::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize AWS SDK Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4a/get-relative-relative-unnormalized/query-signature.txt
Demonstrates how to initialize a generic AWS SDK client. This is a common starting point for interacting with AWS services.
```rust
use aws_config::load_from_environment;
#[tokio::main]
async fn main() {
let config = load_from_environment().await;
let _client = aws_sdk_s3::Client::new(config);
}
```
--------------------------------
### Initialize Free Tier Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/freetier/README.md
Initialize the AWS SDK for Rust Free Tier client. This example demonstrates loading configuration from environment variables and creating a client instance.
```rust
use aws_sdk_freetier as freetier;
#[::tokio::main]
async fn main() -> Result<(), freetier::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_freetier::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize AWS SDK for IoT Device Advisor Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/iotdeviceadvisor/README.md
Create an AWS SDK for Rust client for IoT Device Advisor. This example loads configuration from environment variables and initializes an asynchronous client using Tokio.
```rust
use aws_sdk_iotdeviceadvisor as iotdeviceadvisor;
#[::tokio::main]
async fn main() -> Result<(), iotdeviceadvisor::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_iotdeviceadvisor::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Create an IoT Wireless Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/iotwireless/README.md
Initialize an AWS SDK for Rust client for the IoT Wireless service. This example demonstrates loading configuration from environment variables and creating a client instance.
```rust
use aws_sdk_iotwireless as iotwireless;
#[::tokio::main]
async fn main() -> Result<(), iotwireless::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_iotwireless::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize EBS Client in Rust
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/ebs/README.md
Create an instance of the AWS SDK for Rust EBS client. This example loads configuration from the environment and uses Tokio for asynchronous execution.
```rust
use aws_sdk_ebs as ebs;
#[::tokio::main]
async fn main() -> Result<(), ebs::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_ebs::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize ECR Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/ecr/README.md
Demonstrates how to load AWS configuration from environment variables and create a new ECR client. This is a common starting point for interacting with Amazon ECR using the SDK.
```rust
use aws_sdk_ecr as ecr;
#[::tokio::main]async fn main() -> Result<(), ecr::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_ecr::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize WorkDocs Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/workdocs/README.md
Instantiate a WorkDocs client using the AWS SDK for Rust. This example demonstrates loading configuration from environment variables and creating a client for making asynchronous API calls.
```rust
use aws_sdk_workdocs as workdocs;
#[::tokio::main]
async fn main() -> Result<(), workdocs::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_workdocs::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize IVS Real-Time Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/ivsrealtime/README.md
Demonstrates how to initialize the IVS Real-Time client using environment variables for configuration. This is a common starting point for interacting with the IVS Real-Time API.
```rust
use aws_sdk_ivsrealtime as ivsrealtime;
#[::tokio::main]
async fn main() -> Result<(), ivsrealtime::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_ivsrealtime::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize Resilience Hub Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/resiliencehub/README.md
Create a Resilience Hub client using the AWS SDK for Rust. This example shows how to load configuration from environment variables and instantiate the client within an asynchronous Tokio runtime.
```rust
use aws_sdk_resiliencehub as resiliencehub;
#[::tokio::main] async fn main() -> Result<(), resiliencehub::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_resiliencehub::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### HTTP Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-slash-pointless-dot-unnormalized/header-signed-request.txt
This snippet shows an example of an HTTP GET request with specific headers, including the Authorization header for AWS signing.
```http
GET /./example HTTP/1.1
Host:example.amazonaws.com
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=beb03f223f7deae4146464f06e29eebbee9c8afbe15c290cf07aa8b119e14cff
```
--------------------------------
### HTTP Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-vanilla-with-session-token/header-signed-request.txt
This is an example of an HTTP GET request with AWS v4 signing headers. It includes security token, date, and authorization details.
```http
GET / HTTP/1.1
Host:example.amazonaws.com
X-Amz-Security-Token:6e86291e8372ff2a2260956d9b8aae1d763fbf315fa00fa31553b73ebf194267
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=07ec1639c89043aa0e3e2de82b96708f198cceab042d4a97044c66dd9f74e7f8
```
--------------------------------
### HTTP Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-vanilla-query-order-key-case/header-signed-request.txt
This snippet shows an example of an HTTP GET request with AWS Signature Version 4. It includes common headers like Host, X-Amz-Date, and Authorization.
```http
GET /?Param2=value2&Param1=value1 HTTP/1.1
Host:example.amazonaws.com
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=b97d918cfa904a5beff61c982a1b6f458b799221646efd99d3219ec94cdf2500
```
--------------------------------
### Initialize MediaPackage Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/mediapackage/README.md
Create an asynchronous MediaPackage client by loading configuration from the environment and then instantiating the client. This client is used to make calls to the MediaPackage service.
```rust
use aws_sdk_mediapackage as mediapackage;
#[::tokio::main]
async fn main() -> Result<(), mediapackage::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_mediapackage::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### HTTP GET Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-utf8/header-signed-request.txt
This snippet shows a basic HTTP GET request with custom headers, including Host and X-Amz-Date, and an Authorization header formatted for AWS Signature Version 4.
```http
GET /ሴ HTTP/1.1
Host:example.amazonaws.com
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=8318018e0b0f223aa2bbf98705b62bb787dc9c0e678f255a891fd03141be5d85
```
--------------------------------
### Example HTTP Request with AWS Signature
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-header-value-multiline/header-signed-request.txt
This example demonstrates a typical HTTP GET request to an AWS service, including the necessary headers for authentication with AWS4-HMAC-SHA256. Ensure the 'Authorization' header is correctly formatted with your credentials and signature.
```http
GET / HTTP/1.1
Host:example.amazonaws.com
My-Header1:value1
value2
value3
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=cfd34249e4b1c8d6b91ef74165d41a32e5fab3306300901bb65a51a73575eefd
```
--------------------------------
### HTTP Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-slash-unnormalized/header-signed-request.txt
This snippet shows a basic HTTP GET request with necessary headers for AWS authentication. Ensure the date and signature are correctly generated for your specific request.
```http
GET // HTTP/1.1
Host:example.amazonaws.com
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=c88bcd3d312d75078c0cd961d6deae3f4c754924b01669efcfcb439fd5e5b76e
```
--------------------------------
### Initialize BCM Pricing Calculator Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/bcmpricingcalculator/README.md
Demonstrates how to load AWS configuration from environment variables and create a new BCM Pricing Calculator client. This is the standard way to begin interacting with the service.
```rust
use aws_sdk_bcmpricingcalculator as bcmpricingcalculator;
#[::tokio::main]
async fn main() -> Result<(), bcmpricingcalculator::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_bcmpricingcalculator::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize Serverless Application Repository Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/serverlessapplicationrepository/README.md
Demonstrates how to load AWS configuration from environment variables and create a new Serverless Application Repository client. Ensure Tokio is added as a dependency for asynchronous execution.
```rust
use aws_sdk_serverlessapplicationrepository as serverlessapplicationrepository;
#[::tokio::main]
async fn main() -> Result<(), serverlessapplicationrepository::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_serverlessapplicationrepository::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### HTTP Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/post-x-www-form-urlencoded-parameters/header-signed-request.txt
This example shows a sample HTTP POST request with AWS Signature Version 4 authentication headers.
```http
POST / HTTP/1.1
Content-Type:application/x-www-form-urlencoded; charset=utf-8
Host:example.amazonaws.com
Content-Length:13
X-Amz-Date:20150830T123600Z
x-amz-content-sha256:9095672bbd1f56dfc5b65f3e153adc8731a4a654192329106275f4c7b24d0b6e
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=328d1b9eaadca9f5818ef05e8392801e091653bafec24fcab71e7344e7f51422
Param1=value1
```
--------------------------------
### Control Catalog Client Initialization
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/controlcatalog/README.md
Demonstrates how to initialize the Control Catalog client using environment configuration. This client can then be used to make calls to the Control Catalog API.
```APIDOC
## Control Catalog Client Initialization
### Description
This code snippet shows how to set up the AWS SDK for Rust's Control Catalog client. It loads configuration from the environment and creates a new client instance, which is the entry point for interacting with the Control Catalog API.
### Language
Rust
### Code Example
```rust,no_run
use aws_sdk_controlcatalog as controlcatalog;
#[::tokio::main]
async fn main() -> Result<(), controlcatalog::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_controlcatalog::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
### Dependencies
Ensure you have the following dependencies in your `Cargo.toml`:
```toml
[dependencies]
aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
aws-sdk-controlcatalog = "1.88.0"
tokio = { version = "1", features = ["full"] }
```
```
--------------------------------
### HTTP POST Request Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/post-header-key-sort/header-signed-request.txt
This example shows a basic HTTP POST request with custom headers and an Authorization header formatted for AWS Signature Version 4.
```http
POST / HTTP/1.1
Host:example.amazonaws.com
My-Header1:value1
X-Amz-Date:20150830T123600Z
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c5410059b04c1ee005303aed430f6e6645f61f4dc9e1461ec8f8916fdf18852c
```
--------------------------------
### XSS via href with Encoded Start of Heading
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/lambda/tests/blns/blns.txt
Demonstrates XSS using a JavaScript URI in an href attribute, with an encoded Start of Heading character (\x13). This tests handling of control characters.
```html
test
```
--------------------------------
### Initialize Detective Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/detective/README.md
Demonstrates how to create a new Detective client using configuration loaded from environment variables. Ensure Tokio is added as a dependency for asynchronous operations.
```rust
use aws_sdk_detective as detective;
#[::tokio::main]
async fn main() -> Result<(), detective::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_detective::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### XSS via href with Encoded Start of Text
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/lambda/tests/blns/blns.txt
Illustrates XSS using a JavaScript URI in an href attribute, with an encoded Start of Text character (\x03). This tests handling of control characters.
```html
test
```
--------------------------------
### Create MediaStore Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/mediastore/README.md
Initialize an AWS SDK for Rust MediaStore client using configuration loaded from environment variables. Tokio is required for asynchronous operations.
```rust
use aws_sdk_mediastore as mediastore;
#[::tokio::main] async fn main() -> Result<(), mediastore::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_mediastore::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Example AWS Signed HTTP Request
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/post-x-www-form-urlencoded/header-signed-request.txt
This example demonstrates the structure of a signed HTTP POST request to an AWS service. It includes common headers like Content-Type, Host, X-Amz-Date, and Authorization, which are crucial for AWS authentication.
```http
POST / HTTP/1.1
Content-Type:application/x-www-form-urlencoded
Host:example.amazonaws.com
Content-Length:13
X-Amz-Date:20150830T123600Z
x-amz-content-sha256:9095672bbd1f56dfc5b65f3e153adc8731a4a654192329106275f4c7b24d0b6e
Authorization:AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=d3875051da38690788ef43de4db0d8f280229d82040bfac253562e56c3f20e0b
Param1=value1
```
--------------------------------
### Create an IoTThingsGraph Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/iotthingsgraph/README.md
Instantiate an AWS SDK for Rust client for the IoTThingsGraph service. This requires loading configuration from the environment and Tokio for asynchronous execution.
```rust
use aws_sdk_iotthingsgraph as iotthingsgraph;
#[::tokio::main]
async fn main() -> Result<(), iotthingsgraph::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_iotthingsgraph::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### AWS Signature V4 Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4/get-slashes-unnormalized/query-canonical-request.txt
This example demonstrates the components of an AWS Signature Version 4 request, including the algorithm, credential scope, date, expiration, and signed headers. It also shows the host and the payload hash.
```text
GET
//example//
X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIDEXAMPLE%2F20150830%2Fus-east-1%2Fservice%2Faws4_request&X-Amz-Date=20150830T123600Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host
host:example.amazonaws.com
host
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
```
--------------------------------
### Initialize GuardDuty Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/guardduty/README.md
Demonstrates how to load AWS configuration from environment variables and create a GuardDuty client. Ensure Tokio is added as a dependency for asynchronous execution.
```rust
use aws_sdk_guardduty as guardduty;
#[::tokio::main]
async fn main() -> Result<(), guardduty::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_guardduty::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### StartMediaAnalysisJob
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/rekognition/README.md
Starts a media analysis job.
```APIDOC
## StartMediaAnalysisJob
### Description
Starts a media analysis job.
### Method
POST
### Endpoint
/
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
--------------------------------
### Create an IoT SiteWise Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/iotsitewise/README.md
Initialize an IoT SiteWise client using configuration loaded from environment variables. Tokio is required for asynchronous operations.
```rust
use aws_sdk_iotsitewise as iotsitewise;
#[::tokio::main]
async fn main() -> Result<(), iotsitewise::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_iotsitewise::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### GetCelebrityInfo
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/rekognition/README.md
Gets detailed information about a celebrity.
```APIDOC
## GetCelebrityInfo
### Description
Gets detailed information about a celebrity.
### Method
POST
### Endpoint
/
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
--------------------------------
### Initialize SageMaker Job Runtime Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/sagemakerjobruntime/README.md
Demonstrates how to load AWS configuration from environment variables and create a SageMaker Job Runtime client. Ensure Tokio is added as a dependency for asynchronous execution.
```rust
use aws_sdk_sagemakerjobruntime as sagemakerjobruntime;
#[::tokio::main]
async fn main() -> Result<(), sagemakerjobruntime::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_sagemakerjobruntime::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### GetMediaAnalysisJob
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/rekognition/README.md
Gets the details of a media analysis job.
```APIDOC
## GetMediaAnalysisJob
### Description
Gets the details of a media analysis job.
### Method
POST
### Endpoint
/
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
None
#### Response Example
None
```
--------------------------------
### Initialize Transfer Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/transfer/README.md
Demonstrates how to load AWS configuration from environment variables and create a Transfer Family client. Requires Tokio for asynchronous execution.
```rust
use aws_sdk_transfer as transfer;
#[::tokio::main]
async fn main() -> Result<(), transfer::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_transfer::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### GetHost
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/codestarconnections/README.md
Returns information about the host, including the setup status.
```APIDOC
## GetHost
### Description
Returns information about the host, including the setup status.
### Method
POST
### Endpoint
/
### Parameters
#### Query Parameters
- **HostName** (string) - Required - The name of the host to return information about.
#### Request Body
None specified in source.
### Request Example
```json
{
"example": "Not specified in source"
}
```
### Response
#### Success Response (200)
- **Name** (string) - The name of the host.
- **ProviderType** (string) - The provider type to use for the host.
- **ProviderEndpoint** (string) - The endpoint of the third-party source provider.
- **VpcConfiguration** (object) - The VPC configuration for the host.
- **VpcId** (string) - The ID of the VPC.
- **SubnetIds** (array) - A list of subnet IDs for the VPC.
- **member** (string) - The ID of a subnet.
- **SecurityGroupIds** (array) - A list of security group IDs for the VPC.
- **member** (string) - The ID of a security group.
- **HostArn** (string) - The Amazon Resource Name (ARN) that represents the host.
- **Status** (string) - The status of the host.
- **PublicAuthToken** (string) - The public authentication token for the host. This field is deprecated and will be removed in a future version.
#### Response Example
```json
{
"example": "Not specified in source"
}
```
```
--------------------------------
### CreateHost
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/codestarconnections/README.md
Creates a host that represents the infrastructure where your provider is installed.
```APIDOC
## CreateHost
### Description
Creates a host that represents the infrastructure where your provider is installed.
### Method
POST
### Endpoint
/
### Parameters
#### Query Parameters
- **Name** (string) - Required - The name of the host to create.
- **ProviderType** (string) - Required - The provider type to use for the host.
- **ProviderEndpoint** (string) - Required - The endpoint of the third-party source provider.
- **VpcConfiguration** (object) - Optional - The VPC configuration for the host.
- **VpcId** (string) - Required - The ID of the VPC.
- **SubnetIds** (array) - Required - A list of subnet IDs for the VPC.
- **member** (string) - The ID of a subnet.
- **SecurityGroupIds** (array) - Required - A list of security group IDs for the VPC.
- **member** (string) - The ID of a security group.
#### Request Body
None specified in source.
### Request Example
```json
{
"example": "Not specified in source"
}
```
### Response
#### Success Response (200)
- **Name** (string) - The name of the host.
- **ProviderType** (string) - The provider type to use for the host.
- **ProviderEndpoint** (string) - The endpoint of the third-party source provider.
- **VpcConfiguration** (object) - The VPC configuration for the host.
- **VpcId** (string) - The ID of the VPC.
- **SubnetIds** (array) - A list of subnet IDs for the VPC.
- **member** (string) - The ID of a subnet.
- **SecurityGroupIds** (array) - A list of security group IDs for the VPC.
- **member** (string) - The ID of a security group.
- **HostArn** (string) - The Amazon Resource Name (ARN) that represents the host.
- **Status** (string) - The status of the host.
- **PublicAuthToken** (string) - The public authentication token for the host. This field is deprecated and will be removed in a future version.
#### Response Example
```json
{
"example": "Not specified in source"
}
```
```
--------------------------------
### GetPackageVersionReadme
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/codeartifact/README.md
Gets the readme file or descriptive text for a package version.
```APIDOC
## GetPackageVersionReadme
### Description
Gets the readme file or descriptive text for a package version.
### Method
GET
### Endpoint
/
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```json
{
"example": "Not specified in source"
}
```
### Response
#### Success Response (200)
None
#### Response Example
```json
{
"example": "Not specified in source"
}
```
```
--------------------------------
### Delete an S3 Object
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4a/get-relative-relative-unnormalized/query-signature.txt
Example of deleting an object from an S3 bucket. This operation is permanent.
```rust
use aws_config::load_from_environment;
use aws_sdk_s3::Client;
#[tokio::main]
async fn main() -> Result<(), aws_sdk_s3::Error> {
let config = load_from_environment().await;
let client = Client::new(config);
let bucket_name = "my-unique-bucket-name-12345";
let object_key = "my-file.txt";
client
.delete_object()
.bucket(bucket_name)
.key(object_key)
.send()
.await?;
println!("Object '{}' deleted from bucket '{}'.", object_key, bucket_name);
Ok(())
}
```
--------------------------------
### Initialize MediaPackage v2 Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/mediapackagev2/README.md
Create an asynchronous MediaPackage v2 client using configuration loaded from environment variables. This client is used to make calls to the MediaPackage v2 API.
```rust
use aws_sdk_mediapackagev2 as mediapackagev2;
#[::tokio::main]
async fn main() -> Result<(), mediapackagev2::Error> {
let config = aws_config::load_from_env().await;
let client = mediapackagev2::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize UXC Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/uxc/README.md
Create a UXC client instance by loading configuration from environment variables and then initializing the client. This client is used to make calls to the UXC service.
```rust
use aws_sdk_uxc as uxc;
#[::tokio::main]
async fn main() -> Result<(), uxc::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_uxc::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Pipeline Operations
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/codepipeline/README.md
Operations for creating, deleting, retrieving, listing, starting, stopping, and updating pipelines.
```APIDOC
## CreatePipeline
### Description
Creates a uniquely named pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **pipeline** (Pipeline) - Required - The name of the pipeline, the Amazon Resource Name (ARN) of the pipeline, and the metadata of the pipeline.
## DeletePipeline
### Description
Deletes the specified pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **name** (string) - Required - The name of the pipeline to delete.
## GetPipeline
### Description
Returns information about the pipeline structure and pipeline metadata, including the pipeline Amazon Resource Name (ARN).
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **name** (string) - Required - The name of the pipeline for which to get information.
- **version** (integer) - Optional - The version number of the pipeline. If not specified, the latest version is returned.
## GetPipelineExecution
### Description
Returns information about a specific execution of a pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **pipelineName** (string) - Required - The name of the pipeline.
- **pipelineVersion** (integer) - Required - The version number of the pipeline.
- **executionId** (string) - Required - The ID of the pipeline execution to retrieve.
## GetPipelineState
### Description
Returns information about the current state of the stages and actions of a pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **name** (string) - Required - The name of the pipeline.
## ListActionExecutions
### Description
Returns action-level details for past executions. The details include full stage and action-level details, including individual action duration, status, any errors that occurred during the execution, and input and output artifact location details.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **pipelineName** (string) - Required - The name of the pipeline.
- **actionName** (string) - Required - The name of the action.
- **maxResults** (integer) - Optional - The maximum number of action executions to return.
- **nextToken** (string) - Optional - The token that specifies a page of results to return.
## ListPipelines
### Description
Gets a summary of all of the pipelines associated with your account.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **maxResults** (integer) - Optional - The maximum number of pipelines to return.
- **nextToken** (string) - Optional - The token that specifies a page of results to return.
## ListPipelineExecutions
### Description
Gets a summary of the most recent executions for a pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **pipelineName** (string) - Required - The name of the pipeline for which to get execution history.
- **maxResults** (integer) - Optional - The maximum number of pipeline executions to return.
- **nextToken** (string) - Optional - The token that specifies a page of results to return.
## StartPipelineExecution
### Description
Runs the most recent revision of an artifact through the pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **name** (string) - Required - The name of the pipeline to start.
## StopPipelineExecution
### Description
Stops the specified pipeline execution from continuing through the pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **pipelineName** (string) - Required - The name of the pipeline.
- **queueVersion** (integer) - Required - The version number of the pipeline execution to stop.
- **reason** (string) - Required - The reason for stopping the pipeline execution.
## UpdatePipeline
### Description
Updates a pipeline with edits or changes to the structure of the pipeline.
### Method
POST
### Endpoint
/
### Parameters
#### Request Body
- **pipeline** (Pipeline) - Required - The name of the pipeline that is updated. The pipeline must be renamed or the version number must be updated. Otherwise, an InvalidInputException is thrown.
```
--------------------------------
### Basic XSS Script Injection
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/lambda/tests/blns/blns.txt
Demonstrates a simple script tag injection. This is a fundamental example of XSS.
```html
```
--------------------------------
### Initialize Control Catalog Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/controlcatalog/README.md
Create a Control Catalog client instance using configuration loaded from environment variables. This client is used to make calls to the Control Catalog API.
```rust
use aws_sdk_controlcatalog as controlcatalog;
#[::tokio::main]
async fn main() -> Result<(), controlcatalog::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_controlcatalog::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Create Launch Wizard Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/launchwizard/README.md
Initialize a Launch Wizard client using configuration loaded from environment variables. This client is used to interact with the Launch Wizard service.
```rust
use aws_sdk_launchwizard as launchwizard;
#[::tokio::main]
async fn main() -> Result<(), launchwizard::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_launchwizard::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Download a File from S3
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4a/get-relative-relative-unnormalized/query-signature.txt
Shows how to download a file from an S3 bucket. This example retrieves the object and prints its content.
```rust
use aws_config::load_from_environment;
use aws_sdk_s3::Client;
#[tokio::main]
async fn main() -> Result<(), Box> {
let config = load_from_environment().await;
let client = Client::new(config);
let bucket_name = "my-unique-bucket-name-12345";
let object_key = "my-file.txt";
let resp = client
.get_object()
.bucket(bucket_name)
.key(object_key)
.send()
.await?;
let body = resp.body.collect().await?;
let content = String::from_utf8(body.to_vec())?;
println!("Content of '{}':\n{}", object_key, content);
Ok(())
}
```
--------------------------------
### Initialize QApps Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/qapps/README.md
Initialize the QApps client using configuration loaded from environment variables. This client is used to make calls to the QApps service.
```rust
use aws_sdk_qapps as qapps;
#[::tokio::main]
async fn main() -> Result<(), qapps::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_qapps::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Upload a File to S3
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4a/get-relative-relative-unnormalized/query-signature.txt
Demonstrates uploading a file to an S3 bucket. This example uses a small file and the PutObject operation.
```rust
use aws_config::load_from_environment;
use aws_sdk_s3::Client;
use std::fs::File;
use std::io::Read;
#[tokio::main]
async fn main() -> Result<(), Box> {
let config = load_from_environment().await;
let client = Client::new(config);
let bucket_name = "my-unique-bucket-name-12345";
let object_key = "my-file.txt";
let file_path = "./my-file.txt";
let mut file = File::open(file_path)?;
let mut contents = Vec::new();
file.read_to_end(&mut contents)?;
client
.put_object()
.bucket(bucket_name)
.key(object_key)
.body(contents.into())
.send()
.await?;
println!("File '{}' uploaded to bucket '{}'.", object_key, bucket_name);
Ok(())
}
```
--------------------------------
### Create WorkSpaces Thin Client Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/workspacesthinclient/README.md
Initialize the WorkSpaces Thin Client client using configuration loaded from environment variables. Tokio is required for asynchronous operations.
```rust
use aws_sdk_workspacesthinclient as workspacesthinclient;
#[::tokio::main]
async fn main() -> Result<(), workspacesthinclient::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_workspacesthinclient::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### AWS SDK for Rust Example
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4a/get-vanilla-utf8-query/header-signature.txt
This is a placeholder for a code snippet from the AWS SDK for Rust project. It appears to be a Git commit hash.
```git-commit
3046022100b47fe24b090d857f34597a58a4e8acd0ea9639462e606af7e1fa1e2c3fae1d630221008ce7f870adf7d2c06f299da0c9870402b027c6a50ff027881655a664ff294cc3
```
--------------------------------
### Initialize EFS Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/efs/README.md
This snippet shows how to create a new EFS client instance. It requires loading AWS configuration from the environment and uses Tokio for asynchronous execution. Ensure you have added the necessary dependencies to your Cargo.toml.
```rust
use aws_sdk_efs as efs;
#[::tokio::main]
async fn main() -> Result<(), efs::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_efs::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Create an S3 Bucket
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/aws-signing-test-suite/v4a/get-relative-relative-unnormalized/query-signature.txt
Example of creating a new S3 bucket using the AWS SDK for Rust. Bucket names must be globally unique.
```rust
use aws_config::load_from_environment;
use aws_sdk_s3::Client;
#[tokio::main]
async fn main() -> Result<(), aws_sdk_s3::Error> {
let config = load_from_environment().await;
let client = Client::new(config);
let bucket_name = "my-unique-bucket-name-12345";
client.create_bucket().bucket(bucket_name).send().await?;
println!("Bucket '{}' created successfully.", bucket_name);
Ok(())
}
```
--------------------------------
### Create IoT Events Data Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/ioteventsdata/README.md
Demonstrates how to create a client for the IoT Events Data service using environment variables for configuration. Ensure Tokio is added as a dependency for asynchronous execution.
```rust
use aws_sdk_ioteventsdata as ioteventsdata;
#[::tokio::main]
async fn main() -> Result<(), ioteventsdata::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_ioteventsdata::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Create Cost and Usage Report Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/costandusagereport/README.md
Demonstrates how to load AWS configuration from environment variables and create a Cost and Usage Report client. This is the initial step for making API calls.
```rust
use aws_sdk_costandusagereport as costandusagereport;
#[::tokio::main]
async fn main() -> Result<(), costandusagereport::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_costandusagereport::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### ListTagsForResource
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/codestarconnections/README.md
Gets information about Amazon Web Services tags for a specified Amazon Resource Name (ARN) in Amazon Web Services CodeStar Connections.
```APIDOC
## ListTagsForResource
### Description
Gets information about Amazon Web Services tags for a specified Amazon Resource Name (ARN) in Amazon Web Services CodeStar Connections.
### Method
POST
### Endpoint
/
### Parameters
#### Query Parameters
- **ResourceArn** (string) - Required - The Amazon Resource Name (ARN) of the resource for which to get tags.
#### Request Body
None specified in source.
### Request Example
```json
{
"example": "Not specified in source"
}
```
### Response
#### Success Response (200)
- **Tags** (array) - A list of tags for the resource.
- **Key** (string) - The key of the tag.
- **Value** (string) - The value of the tag.
#### Response Example
```json
{
"example": "Not specified in source"
}
```
```
--------------------------------
### Initialize BedrockDataAutomation Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/bedrockdataautomation/README.md
Create a BedrockDataAutomation client using configuration loaded from environment variables. This client is used to make calls to the service.
```rust
use aws_sdk_bedrockdataautomation as bedrockdataautomation;
#[::tokio::main]
async fn main() -> Result<(), bedrockdataautomation::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_bedrockdataautomation::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Add SSM Quick Setup Dependency to Cargo.toml
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/ssmquicksetup/README.md
Add the aws-sdk-ssmquicksetup crate and its dependencies to your Rust project's Cargo.toml file. Tokio is required for asynchronous operations.
```toml
[dependencies]
aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
aws-sdk-ssmquicksetup = "1.66.0"
tokio = { version = "1", features = ["full"] }
```
--------------------------------
### Initialize FinSpaceData Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/finspacedata/README.md
Create a FinSpaceData client by loading configuration from the environment and initializing it for asynchronous use with Tokio.
```rust
use aws_sdk_finspacedata as finspacedata;
#[::tokio::main]
async fn main() -> Result<(), finspacedata::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_finspacedata::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Initialize ForecastQuery Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/forecastquery/README.md
Create a ForecastQuery client by loading configuration from the environment and initializing the client. This client is used to make calls to the ForecastQuery service.
```rust
use aws_sdk_forecastquery as forecastquery;
#[::tokio::main]
async fn main() -> Result<(), forecastquery::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_forecastquery::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Scunthorpe Problem Test Strings
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/lambda/tests/blns/blns.txt
These strings are examples of innocuous phrases that might be incorrectly flagged by profanity filters due to containing substrings that resemble offensive words.
```plaintext
Scunthorpe General Hospital
```
```plaintext
Penistone Community Church
```
```plaintext
Lightwater Country Park
```
```plaintext
Jimmy Clitheroe
```
```plaintext
Horniman Museum
```
```plaintext
shitake mushrooms
```
```plaintext
RomansInSussex.co.uk
```
```plaintext
http://www.cum.qc.ca/
```
```plaintext
Craig Cockburn, Software Specialist
```
```plaintext
Linda Callahan
```
```plaintext
Dr. Herman I. Libshitz
```
```plaintext
magna cum laude
```
```plaintext
Super Bowl XXX
```
```plaintext
medieval erection of parapets
```
```plaintext
evaluate
```
```plaintext
mocha
```
```plaintext
expression
```
```plaintext
Arsenal canal
```
```plaintext
classic
```
```plaintext
Tyson Gay
```
```plaintext
Dick Van Dyke
```
```plaintext
basement
```
--------------------------------
### Initialize Connect Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/connect/README.md
Initialize the Connect client using configuration loaded from environment variables. Tokio is required for asynchronous execution.
```rust
use aws_sdk_connect as connect;
#[::tokio::main]
async fn main() -> Result<(), connect::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_connect::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```
--------------------------------
### Create a Kinesis Video Client
Source: https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/kinesisvideo/README.md
Instantiate a Kinesis Video client in your Rust application. This example loads configuration from environment variables and uses Tokio for asynchronous execution.
```rust
use aws_sdk_kinesisvideo as kinesisvideo;
#[::tokio::main] async fn main() -> Result<(), kinesisvideo::Error> {
let config = aws_config::load_from_env().await;
let client = aws_sdk_kinesisvideo::Client::new(&config);
// ... make some calls with the client
Ok(())
}
```