vantage_aws/lib.rs
1//! AWS API wrapper for Vantage — incubating.
2//!
3//! Treat AWS API endpoints as Vantage `TableSource`s. Build an
4//! [`AwsAccount`], hand it to a `Table`, and encode the operation in
5//! the table name as `{protocol}/{array_key}:{service}/{target}`:
6//!
7//! ```text
8//! json1/logGroups:logs/Logs_20140328.DescribeLogGroups
9//! │ │ │ └── X-Amz-Target header value
10//! │ │ └─────── service code (also URL hostname segment)
11//! │ └────────────── response field that holds the row array
12//! └────────────────────── wire protocol
13//!
14//! query/Users:iam/2010-05-08.ListUsers
15//! │ │ │ │
16//! │ │ │ └── "VERSION.Action" — both go in the form body
17//! │ │ └──────── service code (also URL hostname segment)
18//! │ └───────────── response element name (Query lists wrap in <member>)
19//! └─────────────────── wire protocol
20//! ```
21//!
22//! Two protocols ship today: **JSON-1.1** for CloudWatch, ECS, KMS,
23//! DynamoDB control-plane, etc.; and **Query** (form-encoded request,
24//! XML response) for IAM, STS, EC2, ELBv1, SES, etc. Both are routed
25//! through the same `AwsAccount` `TableSource`, so relations span
26//! services and protocols freely.
27//!
28//! Conditions on the table fold into the request body. v0 is
29//! read-only, first-page only — pagination and writes arrive later.
30//!
31//! Ready-made models live under [`models`] if you want to skip the
32//! table-name dance and start querying.
33//!
34//! ```no_run
35//! # use vantage_aws::{AwsAccount, eq};
36//! # use vantage_table::table::Table;
37//! # use vantage_types::EmptyEntity;
38//! # async fn run() -> vantage_core::Result<()> {
39//! // env vars first, falling back to ~/.aws/credentials [default]
40//! let aws = AwsAccount::from_default()?;
41//!
42//! let mut groups: Table<AwsAccount, EmptyEntity> = Table::new(
43//! "json1/logGroups:logs/Logs_20140328.DescribeLogGroups",
44//! aws,
45//! );
46//! groups.add_condition(eq("logGroupNamePrefix", "/aws/lambda/"));
47//! # Ok(()) }
48//! ```
49
50mod account;
51mod condition;
52mod dispatch;
53mod impls;
54mod json1;
55mod json10;
56mod operation;
57mod query;
58mod restjson;
59mod restxml;
60mod sign;
61
62pub mod dynamodb;
63pub mod models;
64pub mod types;
65
66pub use account::AwsAccount;
67pub use condition::{AwsCondition, eq, in_};
68pub use operation::AwsOperation;
69pub use types::{AnyAwsType, Arn, AwsDateTime, typed_records, untyped_records};
70
71#[doc(hidden)]
72pub mod __test_support {
73 //! Internal hooks for integration tests under `tests/`. Not part of
74 //! the public API.
75 pub use crate::sign::{SignedHeader, sign_v4};
76}