stratosphere
Type-safe CloudFormation template generation library for Rust.
Stratosphere provides a type-safe way to generate AWS CloudFormation templates in Rust, with compile-time validation of resource types and properties.
Getting Started
Generate Rust types for the AWS services you need, then build your CloudFormation template:
use *;
use ec2;
// Generate types for AWS services
services!;
// Build your CloudFormation template using the generated resource macros
let template = build;
// Convert to JSON for use with CloudFormation APIs
let json = to_string_pretty.unwrap;
// This JSON can now be used with AWS CloudFormation APIs
Features
- Type-safe resource definitions: Generated types for all AWS CloudFormation resources
- Compile-time validation: Catch errors before deployment
- CloudFormation intrinsic functions: Type-safe wrappers for
Fn::Sub,Fn::Join,Ref, etc. - Template builder API: Fluent interface for constructing templates
- Helper macros: Convenient macros for parameters, outputs, and common patterns
Module Organization
generator: Procedural macros for generating CloudFormation resource typestemplate: Core template types and builder APIvalue: CloudFormation values and intrinsic functionsresource_specification: AWS resource type definitionstoken: Code generation utilities