liveBook · Manning

Infrastructure as code

As explained in Write Powerful Rust Macros

Infrastructure as code is the practice of defining and managing computing infrastructure through executable code or declarative machine-readable configuration.

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

How Write Powerful Rust Macros covers it

How deep it goes
Explains IaC benefits, AWS tooling, custom syntax parsing, macro composition, and asynchronous resource creation without detailing deployment operations.
Examples
Uses CloudFormation templates, AWS CDK definitions, and a Rust macro that parses infrastructure syntax and creates AWS resources.
What you can do after
Build it from scratch by designing a Rust infrastructure DSL that parses declarations and invokes asynchronous AWS SDK operations.
How it connects
Links infrastructure as code to domain-specific languages, AWS, CloudFormation, procedural macros, declarative macros, and asynchronous Rust SDK calls.

Also explained in

Compare how 14 books explain infrastructure as code →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Write Powerful Rust Macros. The section links point to the parts of the book it draws on.