Infrastructure as code (IaC) defines an application's infrastructure as readable text or executable code. The specification records operating systems, resource sizes, storage, dependencies, and other requirements so environments can be created, destroyed, updated, reproduced, and version controlled from one description. section 9.1 section 9.11
A practical IaC workflow can:
- Store infrastructure requirements as living documentation that makes environments easier to reason about and reproduce when debugging. section 9.1
- Represent AWS infrastructure with CloudFormation JSON or YAML templates, which create stacks containing application resources. section 9.1
- Use a language-oriented tool such as AWS CDK, which translates TypeScript or Python infrastructure definitions into CloudFormation templates. section 9.1
- Create a custom Rust infrastructure DSL with a function-like procedural macro, struct-based parsing, custom keywords, and asynchronous AWS SDK calls. section 9.0 section 9.11
A Rust infrastructure DSL
A macro can let application code describe cloud resources in a custom syntax rather than scattering infrastructure logic across a separate system. The macro parses structs and keywords, invokes asynchronous Rust SDK operations, and creates the specified AWS resources. Declarative and procedural macros can be combined to reduce duplication while keeping infrastructure and application logic in one repository and language. section 9.0 section 9.11













