1 unstable release

0.1.0 Jun 3, 2024

#14 in #cdk

MIT/Apache

9KB
251 lines

cdk-rs

License Crates.io Crates.io Docs CI

(WIP) Rust support for the AWS Cloud Development Kit (CDK).

use cdk_builder::{ec2, s3, App, Layer, Stack};

struct HelloStack;

impl Stack for HelloStack {
    fn run(me: &mut Layer<Self>) {
        s3::Bucket {
            name: "HelloBucket",
            versioned: true,
        }
        .stack(me);

        let vpc = ec2::Vpc {
            name: "HelloVpc",
            max_azs: 3,
        }
        .stack(me);

        ec2::Instance {
            name: "HelloInstance",
            vpc: &vpc,
        }
        .stack(me);
    }
}

#[tokio::main]
async fn main() {
    let mut app = App::new();
    app.stack(HelloStack);
    app.run().await;
}

Installation

cargo install cargo-cdk
cargo cdk build
cargo cdk ls

Dependencies

~13–28MB
~419K SLoC