cloudformatious

crates.io docs.rs

⚠️ This crate is WIP.

An extension trait for rusoto_cloudformation::CloudFormationClient offering richly typed higher-level APIs to perform long-running operations and await their termination or observe their progress.

```rust + norun use futuresutil::StreamExt; use rusotocloudformation::CloudFormationClient; use rusotocore::Region;

use cloudformatious::{ApplyStackInput, CloudFormatious, DeleteStackInput, TemplateSource};

[tokio::main]

async fn main() -> Result<(), Box> { let client = CloudFormationClient::new(Region::EuWest2);

let input = ApplyStackInput::new("my-stack", TemplateSource::inline("{}"));
let mut stack = client.apply_stack(input);

let mut events = stack.events();
while let Some(event) = events.next().await {
    eprintln!("{:#?}", event);
};

let output = stack.await?;
eprintln!("Stack applied");
println!("{:#?}", output);

let input = DeleteStackInput::new(output.stack_id);
client.delete_stack(input).await?;

println!("Stack deleted");

Ok(())

} ```

Motivation

CloudFormation's API is relatively low-level. This makes it possible to implement fairly advanced workflows involving things like manual review of changes before applying, but it makes the common case of an idempotent 'apply this template' deployment a bit awkward. There are other tools that can mitigate this, such as the aws cloudformation deploy high-level command, but their output is very limited so they only really do half of the work. Furthermore, the tools that I'm aware of are primarily invoked from the shell, meaning they cannot be integrated natively into programs that wish to orchestrate CloudFormation stacks.

Also, I like CloudFormation and programming in Rust so this is fun for me 🤷‍♂️

Current status

The CloudFormatious extension trait has the following methods:

In both cases, the API is a bit more ergonomic than rusoto_cloudformation and the API is richer. In particular:

This is enough for my current use-cases.

Contributing

Feedback and PRs are welcome. However, if you'd like to add any non-trivial functionality it may be worth opening an issue to discuss it first.

License

MIT