Skip to content

Commit

Permalink
Rust: Aurora Scenario (#5476)
Browse files Browse the repository at this point in the history
* WIP scenario outline

* Finished fleshing out scenario structure.

* 80% impl and need to do more research on Aurora DB Engines, Engine Families, etc

* Use secrecy for the password and refactor the bin.

Types check

* Use constant DB_ENGINE

* Better handle existing parameter group.

Refactor: extracted rds caller

Tests for set_engine

Added get_engines test

Finished non-waiter tests

Added waiting test

* Split scenario mod and tests.

* Add snapshot

* Moved Aurora, bump the clap version, and add Aurora metadata.

* README update

* Fix snippet_files bad file path

* Fix metadata

* Fix rename

* Format

* Editorial updates
  • Loading branch information
DavidSouther authored Oct 24, 2023
1 parent 38d57ce commit a8606e2
Show file tree
Hide file tree
Showing 70 changed files with 2,732 additions and 80 deletions.
169 changes: 164 additions & 5 deletions .doc_gen/metadata/aurora_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ aurora_Hello:
- description: Code for the hello_aurora.cpp source file.
snippet_tags:
- cpp.example_code.aurora.hello_aurora
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.get_cluster.usage
- rust.aurora.describe_db_clusters.wrapper
- rust.aurora.get_cluster.test
services:
aurora: {DescribeDBClusters}
aurora_DescribeDBClusterParameterGroups:
Expand Down Expand Up @@ -165,6 +174,15 @@ aurora_CreateDBClusterParameterGroup:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.CreateDBClusterParameterGroup
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.set_engine.usage
- rust.aurora.create_db_cluster_parameter_group.wrapper
- rust.aurora.set_engine.test
services:
aurora: {CreateDBClusterParameterGroup}
aurora_DeleteDBClusterParameterGroup:
Expand Down Expand Up @@ -230,6 +248,15 @@ aurora_DeleteDBClusterParameterGroup:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DeleteDBClusterParameterGroup
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.clean_up.usage
- rust.aurora.delete_db_cluster_parameter_group.wrapper
- rust.aurora.clean_up.test
services:
aurora: {DeleteDBClusterParameterGroup}
aurora_DescribeDBClusterParameters:
Expand Down Expand Up @@ -295,6 +322,15 @@ aurora_DescribeDBClusterParameters:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DescribeDBClusterParameters
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.cluster_parameters.usage
- rust.aurora.describe_db_cluster_parameters.wrapper
- rust.aurora.cluster_parameters.test
services:
aurora: {DescribeDBClusterParameters}
aurora_ModifyDBClusterParameterGroup:
Expand Down Expand Up @@ -360,6 +396,15 @@ aurora_ModifyDBClusterParameterGroup:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.ModifyDBClusterParameterGroup
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.update_auto_increment.usage
- rust.aurora.modify_db_cluster_parameter_group.wrapper
- rust.aurora.update_auto_increment.test
services:
aurora: {ModifyDBClusterParameterGroup}
aurora_DescribeDBClusters:
Expand Down Expand Up @@ -425,6 +470,15 @@ aurora_DescribeDBClusters:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DescribeDBClusters
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.start_cluster_and_instance.usage
- rust.aurora.describe_db_clusters.wrapper
- rust.aurora.start_cluster_and_instance.test
services:
aurora: {DescribeDBClusters}
aurora_CreateDBCluster:
Expand Down Expand Up @@ -490,6 +544,15 @@ aurora_CreateDBCluster:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.CreateDBCluster
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.start_cluster_and_instance.usage
- rust.aurora.create_db_cluster.wrapper
- rust.aurora.start_cluster_and_instance.test
services:
aurora: {CreateDBCluster}
aurora_DeleteDBCluster:
Expand Down Expand Up @@ -555,6 +618,15 @@ aurora_DeleteDBCluster:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DeleteDBCluster
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.clean_up.usage
- rust.aurora.delete_db_cluster.wrapper
- rust.aurora.clean_up.test
services:
aurora: {DeleteDBCluster}
aurora_CreateDBClusterSnapshot:
Expand Down Expand Up @@ -620,6 +692,15 @@ aurora_CreateDBClusterSnapshot:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.CreateDBClusterSnapshot
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.start_cluster_and_instance.usage
- rust.aurora.create_db_cluster_snapshot.wrapper
- rust.aurora.start_cluster_and_instance.test
services:
aurora: {CreateDBClusterSnapshot}
aurora_DescribeDBClusterSnapshots:
Expand Down Expand Up @@ -750,6 +831,15 @@ aurora_CreateDBInstance:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.CreateDBInstance
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.start_cluster_and_instance.usage
- rust.aurora.create_db_instance.wrapper
- rust.aurora.start_cluster_and_instance.test
services:
aurora: {CreateDBInstance}
aurora_DescribeDBEngineVersions:
Expand Down Expand Up @@ -815,6 +905,15 @@ aurora_DescribeDBEngineVersions:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DescribeDBEngineVersions
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.get_engines.usage
- rust.aurora.describe_db_engine_versions.wrapper
- rust.aurora.get_engines.test
services:
aurora: {DescribeDBEngineVersions}
aurora_DescribeOrderableDBInstanceOptions:
Expand Down Expand Up @@ -871,6 +970,15 @@ aurora_DescribeOrderableDBInstanceOptions:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DescribeOrderableDBInstanceOptions
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.get_instance_classes.usage
- rust.aurora.describe_orderable_db_instance_options.wrapper
- rust.aurora.get_instance_classes.test
services:
aurora: {DescribeOrderableDBInstanceOptions}
aurora_DescribeDBInstances:
Expand Down Expand Up @@ -936,6 +1044,15 @@ aurora_DescribeDBInstances:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DescribeDBInstances
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.clean_up.usage
- rust.aurora.describe_db_instances.wrapper
- rust.aurora.clean_up.test
services:
aurora: {DescribeDBInstances}
aurora_DeleteDBInstance:
Expand Down Expand Up @@ -1001,6 +1118,15 @@ aurora_DeleteDBInstance:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.client
- cpp.example_code.aurora.DeleteDBInstance
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- snippet_tags:
- rust.aurora.clean_up.usage
- rust.aurora.delete_db_instance.wrapper
- rust.aurora.clean_up.test
services:
aurora: {DeleteDBInstance}
aurora_Scenario_GetStartedClusters:
Expand Down Expand Up @@ -1079,9 +1205,42 @@ aurora_Scenario_GetStartedClusters:
snippet_tags:
- cpp.example_code.aurora.client_configuration
- cpp.example_code.aurora.get_started_clusters
Rust:
versions:
- sdk_version: 1
github: rust_dev_preview/examples/aurora
excerpts:
- description: A library containing the scenario-specific functions for the Aurora scenario.
snippet_files:
- rust_dev_preview/examples/aurora/src/aurora_scenario/mod.rs
- description: Tests for the library using automocks around the RDS Client wrapper.
snippet_files:
- rust_dev_preview/examples/aurora/src/aurora_scenario/tests.rs
- description: A binary to run the scenario from front to end, using inquirer so that the user can make some decisions.
snippet_files:
- rust_dev_preview/examples/aurora/src/bin/aurora-scenario.rs
- description: A wrapper around the Amazon RDS service that allows automocking for tests.
snippet_files:
- rust_dev_preview/examples/aurora/src/rds.rs
- description: The Cargo.toml with dependencies used in this scenario.
snippet_files:
- rust_dev_preview/examples/aurora/Cargo.toml
services:
aurora: {CreateDBCluster, CreateDBClusterParameterGroup, CreateDBClusterSnapshot,
CreateDBInstance, DeleteDBCluster, DeleteDBClusterParameterGroup, DeleteDBInstance,
DescribeDBClusterParameterGroups, DescribeDBClusterSnapshots, DescribeDBClusters,
DescribeDBEngineVersions, DescribeDBInstances, DescribeOrderableDBInstanceOptions,
DescribeDBClusterParameters, ModifyDBClusterParameterGroup}
aurora:
{
CreateDBCluster,
CreateDBClusterParameterGroup,
CreateDBClusterSnapshot,
CreateDBInstance,
DeleteDBCluster,
DeleteDBClusterParameterGroup,
DeleteDBInstance,
DescribeDBClusterParameterGroups,
DescribeDBClusterSnapshots,
DescribeDBClusters,
DescribeDBEngineVersions,
DescribeDBInstances,
DescribeOrderableDBInstanceOptions,
DescribeDBClusterParameters,
ModifyDBClusterParameterGroup,
}
2 changes: 1 addition & 1 deletion rust_dev_preview/cross_service/detect_faces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next"
aws-sdk-rekognition = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
tokio = { version = "1.20.1", features = ["full"] }
clap = { version = "~4.2", features = ["derive"] }
clap = { version = "~4.4", features = ["derive"] }
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
2 changes: 1 addition & 1 deletion rust_dev_preview/cross_service/detect_labels/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ aws-sdk-rekognition = { git = "https://github.com/awslabs/aws-sdk-rust", branch
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-types = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
tokio = { version = "1.20.1", features = ["full"] }
clap = { version = "~4.2", features = ["derive"] }
clap = { version = "~4.4", features = ["derive"] }
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
kamadak-exif = "0.5.4"
2 changes: 1 addition & 1 deletion rust_dev_preview/cross_service/telephone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ tokio = { version = "1.20.1", features = ["full"] }
bytes = "1"
reqwest = "0.11.4"
serde_json = "1.0"
clap = { version = "~4.2", features = ["derive"] }
clap = { version = "~4.4", features = ["derive"] }
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
1 change: 1 addition & 0 deletions rust_dev_preview/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"apigateway",
"apigatewaymanagement",
"applicationautoscaling",
"aurora",
"auto-scaling",
"autoscalingplans",
"batch",
Expand Down
2 changes: 1 addition & 1 deletion rust_dev_preview/examples/apigateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aws-sdk-apigateway = { git = "https://github.com/awslabs/aws-sdk-rust", branch =
aws-smithy-types-convert = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [
"convert-chrono",
] }
clap = { version = "~4.2", features = ["derive"] }
clap = { version = "~4.4", features = ["derive"] }
thiserror = "1.0"
tokio = { version = "1.20.1", features = ["full"] }
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
2 changes: 1 addition & 1 deletion rust_dev_preview/examples/apigatewaymanagement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next"
aws-sdk-apigatewaymanagement = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
http = "0.2.5"
tokio = { version = "1.20.1", features = ["full"] }
clap = { version = "~4.2", features = ["derive"] }
clap = { version = "~4.4", features = ["derive"] }
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ edition = "2021"
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-sdk-applicationautoscaling = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
tokio = { version = "1.20.1", features = ["full"] }
clap = { version = "~4.2", features = ["derive"] }
clap = { version = "~4.4", features = ["derive"] }
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
25 changes: 25 additions & 0 deletions rust_dev_preview/examples/aurora/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "aurora-code-examples"
authors = [
"David Souther <dpsouth@amazon.com>",
]
edition = "2021"
version = "0.1.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.75"
assert_matches = "1.5.0"
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-smithy-runtime-api = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
aws-sdk-rds = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
inquire = "0.6.2"
mockall = "0.11.4"
phf = { version = "0.11.2", features = ["std", "macros"] }
sdk-examples-test-utils = { path = "../../test-utils" }
secrecy = "0.8.0"
tokio = { version = "1.20.1", features = ["full", "test-util"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
Loading

0 comments on commit a8606e2

Please sign in to comment.