| Crates.io | stratosphere |
| lib.rs | stratosphere |
| version | 0.0.4 |
| created_at | 2025-11-19 05:48:03.905279+00 |
| updated_at | 2026-01-18 03:56:39.287007+00 |
| description | Type-safe CloudFormation template generation library for Rust with comprehensive coverage of all CloudFormation types. Pre-generated types from official AWS resource specifications, feature-gated for minimal compile times. |
| homepage | https://github.com/mbj/mrs/tree/main/stratosphere |
| repository | https://github.com/mbj/mrs/tree/main/stratosphere |
| max_upload_size | |
| id | 1939477 |
| size | 16,812,935 |
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.
Enable the AWS services you need via Cargo features, then build your CloudFormation template:
use stratosphere::template::*;
use stratosphere::services::aws::ec2;
// Build your CloudFormation template using the generated resource macros
let template = Template::build(|t| {
let vpc_cidr = &t.parameter(
"VpcCidr",
stratosphere::Parameter! {
description: "CIDR block for the VPC",
r#type: ParameterType::String,
},
);
let vpc = &t.resource(
"Vpc",
ec2::VPC! {
cidr_block: vpc_cidr
},
);
t.output(
"VpcId",
stratosphere::Output! {
description: "ID of the VPC",
value: vpc,
},
);
});
// Convert to JSON for use with CloudFormation APIs
let json = serde_json::to_string_pretty(&template).unwrap();
// This JSON can now be used with AWS CloudFormation APIs
Enable the AWS services you need in your Cargo.toml:
[dependencies]
stratosphere = { version = "0.0.4", features = ["aws_ec2", "aws_secretsmanager"] }
Each AWS service has its own feature flag (e.g., aws_ec2, aws_s3, aws_lambda).
Fn::Sub, Fn::Join, Ref, etc.Stratosphere provides pre-generated CloudFormation resource types gated behind Cargo features. Enable only the AWS services you need, and your compiled binary will only include those types.
This approach ensures fast compilation times and minimal binary size - you only pay for what you use.
Note: Once Rust's declarative macros 2.0 are stabilized, pre-generation can be removed in favor of on-demand type generation via proc macros with proper namespacing support.
services: Pre-generated CloudFormation resource types organized by vendor and servicetemplate: Core template types and builder APIvalue: CloudFormation values and intrinsic functionsresource_specification: AWS resource type definitions