vantage_aws/lib.rs
1//! AWS API wrapper for Vantage — incubating.
2//!
3//! Treat AWS JSON-1.1 RPC endpoints (CloudWatch Logs, ECS, DynamoDB
4//! control plane, KMS, …) as Vantage `TableSource`s. Build an
5//! [`AwsAccount`], hand it to a `Table`, and encode the operation in
6//! the table name as `array_key:service/target`:
7//!
8//! ```text
9//! "logGroups:logs/Logs_20140328.DescribeLogGroups"
10//! │ │ └── X-Amz-Target header value
11//! │ └────────── service code (also the URL hostname segment)
12//! └────────────────── response field that holds the row array
13//! ```
14//!
15//! Conditions on the table fold into the JSON request body. v0 is
16//! read-only, first-page only, JSON-1.1 only — REST-JSON and S3 will
17//! arrive as separate source types.
18//!
19//! Ready-made CloudWatch models live under [`models`] if you want to
20//! skip the table-name dance and start querying.
21//!
22//! ```no_run
23//! # use vantage_aws::{AwsAccount, eq};
24//! # use vantage_table::table::Table;
25//! # use vantage_types::EmptyEntity;
26//! # async fn run() -> vantage_core::Result<()> {
27//! // env vars first, falling back to ~/.aws/credentials [default]
28//! let aws = AwsAccount::from_default()?;
29//!
30//! let mut groups: Table<AwsAccount, EmptyEntity> = Table::new(
31//! "logGroups:logs/Logs_20140328.DescribeLogGroups",
32//! aws,
33//! );
34//! groups.add_condition(eq("logGroupNamePrefix", "/aws/lambda/"));
35//! # Ok(()) }
36//! ```
37
38mod account;
39mod condition;
40mod json1;
41mod operation;
42mod sign;
43mod transport;
44
45pub mod models;
46
47pub use account::AwsAccount;
48pub use condition::{AwsCondition, eq, in_};
49pub use operation::AwsOperation;
50
51#[doc(hidden)]
52pub mod __test_support {
53 //! Internal hooks for integration tests under `tests/`. Not part of
54 //! the public API.
55 pub use crate::sign::{SignedHeader, sign_v4};
56}