https://github.com/bgauduch/terraform-examples
Library of Terraform examples, covering various topics, first-class citizen for demos !
https://github.com/bgauduch/terraform-examples
aws cloud demo devops examples iac learning plateform-engineering terraform
Last synced: 1 day ago
JSON representation
Library of Terraform examples, covering various topics, first-class citizen for demos !
- Host: GitHub
- URL: https://github.com/bgauduch/terraform-examples
- Owner: bgauduch
- License: mit
- Created: 2026-04-13T11:28:56.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-06-25T17:30:05.000Z (10 days ago)
- Last Synced: 2026-06-25T19:13:25.217Z (10 days ago)
- Topics: aws, cloud, demo, devops, examples, iac, learning, plateform-engineering, terraform
- Homepage:
- Size: 11.1 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Terraform Examples
[](https://github.com/bgauduch/terraform-examples/actions/workflows/terraform.yml)
[](https://github.com/bgauduch/terraform-examples/actions/workflows/release.yml)
[](https://github.com/bgauduch/terraform-examples/releases/latest)
A library of self-contained Terraform examples: reusable patterns, illustrations for blog/LinkedIn posts, and starting points for live tech sessions ("Matinale Tech").
Each example lives under [`examples/`](examples/) and is fully independent - its own `README.md`, tooling (`mise.toml`, `.tflint.hcl`) and Terraform code. Pick one, `cd` into it, follow its README. The toolchain (terraform, tflint, trivy) is managed by [mise](https://mise.jdx.dev/) as the single source of truth - see [`AGENTS.md`](AGENTS.md#toolchain-mise).
## Catalogue
| Example | Type | Tags | Description |
|---------|------|------|-------------|
| [`aws-multi-env`](examples/aws-multi-env/) | `pattern` | `aws` `multi-env` `backend` `workspaces` | Four progressive patterns for managing multiple environments with Terraform CE on AWS. |
| [`terraform-deferred-actions`](examples/terraform-deferred-actions/) | `experiment` | `rc` `deferred-actions` `kms` `unknown-at-plan` | Testing Terraform's experimental *deferred actions* (`plan -allow-deferral`) to inject a KMS key whose ARN is unknown at plan time. |
| [`terraform-query-import`](examples/terraform-query-import/) | `lab` | `aws` `query` `import` `tfquery` `v1.14` | Discover unmanaged infrastructure with `terraform query` + `list` blocks, generate its config, and import it in bulk. |
| [`terraform-module-testing`](examples/terraform-module-testing/) | `lab` | `aws` `terraform-test` `testing` `s3` `validation` | Test a reusable S3 module with the native `terraform test` framework: variable validations (`expect_failures`), plan assertions with `mock_provider`, real apply on AWS, and parallel runs with `state_key`. |
### Taxonomy
- `pattern` - reusable, production-leaning reference.
- `lab` - starting point / TP with progressive steps for a live session.
- `experiment` - preview/RC features, may be intentionally unstable.
## Adding an example
See the golden path in [`AGENTS.md`](AGENTS.md). In short: create `examples//` with its own `README.md`, `mise.toml`, `.tflint.hcl` and Terraform root module(s), then add a row to the catalogue above. CI auto-discovers any directory containing `providers.tf` - no CI change needed.
## Repository standards
- **Git flow**: GitHub flow (short-lived branches off `main`, PR review, squash-merge).
- **Commits**: [Conventional Commits](https://www.conventionalcommits.org/); use the example name as scope (`feat(aws-multi-env): ...`).
- **Versioning**: [SemVer](https://semver.org/), repo-level single release line via release-please.
- **Validation before commit**: `terraform fmt -recursive` (root) and `terraform validate` inside each touched root module.