One Terraform workspace demonstrates the complete Yaffle product loop:
- Open a pull request.
- Yaffle materializes an isolated resource name for
pr-{number}. - The preview plans and applies without changing repository source.
- Merge the pull request.
- Yaffle destroys the preview and applies the original unsuffixed name to
production.
The repository configures one stable filename:
variables.resource_name = "yaffle-product-demo"The Terraform source uses that value directly:
resource "local_file" "demo" {
filename = var.resource_name
}Yaffle treats the same source differently according to environment ownership:
| Event | Environment | Materialized filename |
|---|---|---|
| Pull request opened or updated | pr-{number} |
yaffle-product-demo-{stable-suffix} |
| Pull request closed | pr-{number} |
Preview resource destroyed |
Push to main |
production |
yaffle-product-demo |
The suffix is deterministic for the organization, repository, workspace, and environment. Yaffle
adds it only inside the immutable execution artifact. It does not rewrite main.tf.
Prerequisite: install the Yaffle GitHub App for this repository and connect it to your Yaffle organization.
- Create a branch.
- Change
variables.demo_messageinyaffle.toml. - Open a pull request.
- Watch the Yaffle check create and apply the
pr-{number}preview. - Inspect the
configured_filename,materialized_filename, andenvironmentoutputs. - Merge the pull request.
- Watch Yaffle destroy the preview and run the named
productionenvironment.
The pull-request output should show the configured name and materialized name diverging. The
production output should show both names as yaffle-product-demo.
The demo needs no cloud account, credentials, or billable infrastructure. The exact
hashicorp/local 2.5.3 strategy exercises provider resolution, source transformation, artifact
verification, plan, apply, outputs, and destroy.
The generated file exists only on the ephemeral runner. This is a product-mechanics demonstration,
not a recommendation to manage durable infrastructure with local_file.
tofu -chdir=infra/preview-isolation fmt -check
tofu -chdir=infra/preview-isolation init -backend=false -lockfile=readonly
tofu -chdir=infra/preview-isolation validate