Unverified Commit 762ab413 authored by Al McLean's avatar Al McLean Committed by GitHub
Browse files

Adding cloudformation support (#500)

* Adding cloudformation support

* Fixing formatting
parent 20dcbbf7
Loading
Loading
Loading
Loading
+8621 −0

File added.

Preview size limit exceeded, changes collapsed.

+12 −0
Original line number Diff line number Diff line
[package]
name = "cloudformation"
version = "0.1.0"
authors = ["Alistair McLean <mclean@amazon.com>"]
edition = "2018"

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

[dependencies]
env_logger = "0.8.2"
cloudformation = {package = "aws-sdk-cloudformation", path = "../../build/aws-sdk/cloudformation"}
tokio = { version = "1", features = ["full"] }
+19 −0
Original line number Diff line number Diff line
#[tokio::main]
async fn main() -> Result<(), cloudformation::Error> {
    let client = cloudformation::Client::from_env();
    let stacks = client.list_stacks().send().await?;

    for s in stacks.stack_summaries.unwrap_or_default() {
        let details = format!(
            "{}\t{}\t{:#?}\t{}",
            s.stack_id.as_deref().unwrap_or_default(),
            s.stack_name.as_deref().unwrap_or_default(),
            s.stack_status.unwrap(),
            s.stack_status_reason.as_deref().unwrap_or_default()
        );

        println!("{}", details);
    }

    Ok(())
}