PATTERN Cited by 1 source
Ephemeral preview environments¶
Pattern¶
Deploy a full application stack (or a scoped subset) as a short-lived, IaC-defined cloud environment on demand, run end-to-end validation against it, and tear it down when done. Lifetime is minutes to hours, not weeks. Created by the agent / CI pipeline / developer, not by a central ops team.
Why¶
Local emulation (patterns/local-emulation-first) + hybrid cloud testing (patterns/hybrid-cloud-testing) cover single- service and lightweight-integration validation. End-to-end validation across multiple real cloud services still matters — especially under agentic development where many coordinated changes land together.
Named by the 2026-03-26 AWS Architecture Blog post:
"Preview environments are short-lived stacks deployed on demand for validation. Defined through IaC, they allow an AI agent to deploy a complete application, run smoke tests, and tear everything down when finished."
"Preview environments can reduce integration risk and allow AI-generated changes to be validated safely before reaching production."
Canonical substrate¶
- IaC framework — CloudFormation or CDK; both defined as the named substrate in the 2026-03-26 post.
- Agent / CI deploy credentials — scoped to a dedicated preview account to bound blast radius and cost.
- Deterministic teardown — the agent is expected to
cdk destroy/aws cloudformation delete-stackat the end of every session.
Pairs with¶
- concepts/contract-first-design — when preview environments are expensive or slow to spin up, contract-first mocks let the agent validate integrations before all services are implemented or preview-stacked.
- patterns/local-emulation-first — the cheaper cousin on the feedback ladder.
- patterns/ci-cd-agent-guardrails — CI pipelines commonly gate merges on preview-environment smoke tests.
Caveats¶
- Cost — preview environments are cloud spend. If the agent loop spins one per test iteration, the bill grows fast. The 2026-03-26 post doesn't discuss this tradeoff.
- Provisioning latency — "short-lived" is relative; CloudFormation / CDK stacks can take multiple minutes to come up. Preview envs sit above hybrid-cloud-testing on the feedback ladder for a reason.
- Teardown reliability — if the agent crashes mid-session, leftover stacks accumulate and accrue cost. Operational discipline (TTL tags, nightly sweep) is required but not prescribed in the source.
- No scaling story at many-agent scale. The 2026-03-26 post is single-agent; many agents running preview envs concurrently on a shared account will hit quotas (EIPs, NAT gateways, VPC limits, concurrent stack operations).
Seen in¶
- sources/2026-03-26-aws-architecting-for-agentic-ai-development-on-aws — pattern introduction; named as the end-to-end tier above local/hybrid on the agentic-development feedback ladder.