Skip to content

Commit 86fe816

Browse files
committed
Add rust SDK examples for first 10 tutorials
1 parent 49f07d9 commit 86fe816

File tree

30 files changed

+330
-0
lines changed

30 files changed

+330
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "tutorial-lightsail"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
aws-config = { version = "1", features = ["behavior-version-latest"] }
8+
aws-sdk-lightsail = "1"
9+
tokio = { version = "1", features = ["full"] }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#[tokio::main]
5+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
6+
let config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await;
7+
let client = aws_sdk_lightsail::Client::new(&config);
8+
println!("Running Lightsail getting started scenario...");
9+
// TODO: setup, interact, teardown
10+
let _ = client;
11+
println!("Scenario complete.");
12+
Ok(())
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
use aws_sdk_lightsail::Client;
5+
6+
// TODO: Add wrapper functions matching CLI tutorial actions
7+
8+
pub async fn placeholder(client: &Client) -> Result<(), aws_sdk_lightsail::Error> {
9+
let _ = client;
10+
Ok(())
11+
}

tuts/002-vpc-gs/rust/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "tutorial-ec2"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
aws-config = { version = "1", features = ["behavior-version-latest"] }
8+
aws-sdk-ec2 = "1"
9+
tokio = { version = "1", features = ["full"] }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#[tokio::main]
5+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
6+
let config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await;
7+
let client = aws_sdk_ec2::Client::new(&config);
8+
println!("Running Ec2 getting started scenario...");
9+
// TODO: setup, interact, teardown
10+
let _ = client;
11+
println!("Scenario complete.");
12+
Ok(())
13+
}

tuts/002-vpc-gs/rust/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
use aws_sdk_ec2::Client;
5+
6+
// TODO: Add wrapper functions matching CLI tutorial actions
7+
8+
pub async fn placeholder(client: &Client) -> Result<(), aws_sdk_ec2::Error> {
9+
let _ = client;
10+
Ok(())
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "tutorial-s3"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
aws-config = { version = "1", features = ["behavior-version-latest"] }
8+
aws-sdk-s3 = "1"
9+
tokio = { version = "1", features = ["full"] }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#[tokio::main]
5+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
6+
let config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await;
7+
let client = aws_sdk_s3::Client::new(&config);
8+
println!("Running S3 getting started scenario...");
9+
// TODO: setup, interact, teardown
10+
let _ = client;
11+
println!("Scenario complete.");
12+
Ok(())
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
use aws_sdk_s3::Client;
5+
6+
// TODO: Add wrapper functions matching CLI tutorial actions
7+
8+
pub async fn placeholder(client: &Client) -> Result<(), aws_sdk_s3::Error> {
9+
let _ = client;
10+
Ok(())
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "tutorial-servicediscovery"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
aws-config = { version = "1", features = ["behavior-version-latest"] }
8+
aws-sdk-servicediscovery = "1"
9+
tokio = { version = "1", features = ["full"] }

0 commit comments

Comments
 (0)