Automatically destroy a stack and its resources after a set duration.
A TTL (time-to-live) policy destroys a stack and everything in it once its deadline passes. It’s the mechanism for ephemeral infrastructure: dev workspaces, test environments, demos, anything that should clean itself up without someone remembering to run destroy.
The deadline is expressed one of two ways: a duration (ttl), measured from when the stack is created, or an absolute instant (expiresAt). Either way it counts down in the background: no apply is needed to trigger the eventual destroy. Re-applying the stack does not move the deadline; a ttl always counts from the stack’s creation, and an expiresAt names the instant directly.When the deadline passes, formae destroys the stack and all its resources.
ttl fits infrastructure whose lifetime is known at creation: a sandbox that lives for the workday, a test environment that should survive its CI run and no longer. Because it measures from stack creation, attaching a ttl to a stack that already exists counts the time the stack has already lived: a ttl = 1.h on a three-day-old stack is already expired and the stack is destroyed on the next expiry check.
expiresAt fits deadlines known as a date: the end of a trial, a scheduled teardown, a booking window. It reads the same to every observer, never shifts on re-apply, and is the right form when another system computes the deadline. To destroy an existing stack some time from now, compute the instant and set expiresAt rather than attaching a ttl.
To move a deadline, re-apply the stack with a new expiresAt (or a new ttl; the change applies in place, still anchored to creation). To remove one, re-apply the stack in reconcile mode without the policy.
When the TTL expires, formae checks whether any resource outside the stack depends on a resource inside it:
abort (default): cancel the destruction. The stack stays intact until the dependency is removed.
cascade: delete the dependent resources too, following the dependency chain into other stacks.
cascade can delete resources in stacks you didn’t intend to touch, anywhere the dependency chain leads. Use abort unless you’re certain nothing outside the stack should survive it.
amends "@formae/forma.pkl"import "@formae/formae.pkl"import "@aws/aws.pkl"import "@aws/logs/loggroup.pkl"local devTarget = new formae.Target { label = "dev-target" config = new aws.Config { region = "us-east-1" }}forma { devTarget new formae.Stack { label = "feature-xyz" description = "Temporary dev environment for feature XYZ" policies = new Listing { new formae.TTLPolicy { ttl = 8.h // Destroy after 8 hours onDependents = "abort" // Don't destroy if other resources depend on it } } } new loggroup.LogGroup { label = "feature-logs" stack = "feature-xyz" target = devTarget.res logGroupName = "/dev/feature-xyz/logs" retentionInDays = 1 }}
Absolute deadline, for a stack that must be gone at a known instant:
new formae.Stack { label = "pilot-workshop" description = "Workshop environment for the September pilot" policies = new Listing { new formae.TTLPolicy { expiresAt = "2026-09-01T00:00:00Z" // Destroy at this instant onDependents = "abort" } } }
Reusable TTL policy, shared by every developer’s sandbox stack:
new formae.Stack { label = "pilot-workshop" description = "Workshop environment for the September pilot" policies = new Listing { new formae.TTLPolicy { expiresAt = "2026-09-01T00:00:00Z" // Destroy at this instant onDependents = "abort" } } }
Reusable TTL policy, shared by every developer’s sandbox stack:
amends "@formae/forma.pkl"import "@formae/formae.pkl"import "@aws/aws.pkl"import "@aws/logs/loggroup.pkl"local ephemeralPolicy = new formae.TTLPolicy { label = "ephemeral-4h" ttl = 4.h onDependents = "cascade"}local devTarget = new formae.Target { label = "dev-target" config = new aws.Config { region = "us-east-1" }}forma { ephemeralPolicy devTarget new formae.Stack { label = "alice-dev" description = "Alice's development environment" policies = new Listing { ephemeralPolicy.res } } new loggroup.LogGroup { label = "alice-logs" stack = "alice-dev" target = devTarget.res logGroupName = "/dev/alice/logs" } new formae.Stack { label = "bob-dev" description = "Bob's development environment" policies = new Listing { ephemeralPolicy.res } } new loggroup.LogGroup { label = "bob-logs" stack = "bob-dev" target = devTarget.res logGroupName = "/dev/bob/logs" }}
Policy: inline vs. reusable policies, and how to query them.
Auto-reconcile policy: enforce declared state instead of expiring it. The two can be combined on the same stack.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"formae","colors":{"primary":"#ff8201","light":"#ff8201","dark":"#9c4f00"},"logo":{"light":"https://mintcdn.com/platform-engineering-labs/mNa46DBzXSjV0agT/logo/formae-logo-light.png?fit=max\u0026auto=format\u0026n=mNa46DBzXSjV0agT\u0026q=85\u0026s=8563b5284bd2cf259539ff5e7b9d457f","dark":"https://mintcdn.com/platform-engineering-labs/mNa46DBzXSjV0agT/logo/formae-logo-dark.png?fit=max\u0026auto=format\u0026n=mNa46DBzXSjV0agT\u0026q=85\u0026s=12888995934ece68e08ef7c2c8da99b7"},"favicon":"https://mintcdn.com/platform-engineering-labs/CG7M-6iCStm7YFly/logo/favicon.ico?fit=max\u0026auto=format\u0026n=CG7M-6iCStm7YFly\u0026q=85\u0026s=dbfd5946ac35d39a009c90d67740874a","appearance":{"default":"dark"},"background":{"decoration":"grid","color":{"light":"#f4f5fb","dark":"#05051f"}},"fonts":{"heading":{"family":"Saans","weight":700,"source":"fonts/Saans-Bold.woff2","format":"woff2"},"body":{"family":"Saans","weight":400,"source":"fonts/Saans-Regular.woff2","format":"woff2"}},"styling":{"codeblocks":{"languages":{"custom":["/languages/pkl.json"]}},"latex":true},"banner":{"content":"The formae MCP plugin is now **formae**. Uninstall **formae-mcp** and install **formae**. [Migration steps](/documentation/guides/ai-coding-assistants#migrate-from-formae-mcp).","dismissible":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"platform-engineering-labs","hasAudioNarration":false,"actualSubdomain":"platform-engineering-labs","customDomains":["docs.formae.ai"],"gitSource":{"type":"github","owner":"platform-engineering-labs","repo":"formae-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"5e7fa02b-cbcc-4078-aba0-ba3b5a3518af","liveDeploymentHistoryId":"6ac68da1059039e5661c1ae1","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac68da1059039e5661c1ae1"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac68da1059039e5661c1ae1","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"Documentation","count":103},{"language":"default","tag":"Reference","count":59},{"language":"default","tag":"Plugin development","count":34},{"language":"default","tag":"Cloud providers","count":33},{"language":"default","tag":"Guides","count":32},{"language":"default","tag":"Concepts","count":24},{"language":"default","tag":"Get started","count":22},{"language":"default","tag":"Common patterns","count":22},{"language":"default","tag":"CLI","count":16},{"language":"default","tag":"Tutorial","count":16}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":root{--brand-navy:#02024b;--brand-orange:#ff8201;--brand-orange-deep:#e07301;--brand-sky:#29abe2;--brand-green:#00c153;--brand-radius:12px;--brand-mono:\"Saans Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;--brand-mono-safe:ui-monospace, \"SF Mono\", SFMono-Regular, Menlo, Consolas, monospace;--brand-ink:#0a0a1f;--brand-ink-soft:#494c66;--brand-ink-faint:rgba(2, 2, 75, 0.62);--brand-rail:rgba(255, 255, 255, 0.55);--brand-card:rgba(255, 255, 255, 0.78);--brand-edge:rgba(2, 2, 75, 0.13);--brand-edge-strong:rgba(2, 2, 75, 0.26)}html.dark{--brand-ground:#05051f;--brand-ink:#ffffff;--brand-ink-soft:#cccccc;--brand-ink-faint:rgba(255, 255, 255, 0.55);--brand-rail:rgba(255, 255, 255, 0.03);--brand-card:rgba(255, 255, 255, 0.045);--brand-edge:rgba(255, 255, 255, 0.12);--brand-edge-strong:rgba(255, 255, 255, 0.22)}@font-face{font-family:\"Saans Mono\";src:url(/fonts/SaansMono-Medium.woff2) format(\"woff2\");font-weight:500;font-style:normal;font-display:swap}code,kbd,samp{font-family:var(--brand-mono)}pre,pre code,pre.shiki,pre.shiki code{font-family:var(--brand-mono-safe)}.nav-logo{height:2.625rem!important}.fa-convo{border:1px solid var(--brand-edge);border-radius:var(--brand-radius);background:var(--brand-card);overflow:hidden;margin:1.1rem 0}.fa-convo-head{display:flex;align-items:center;gap:8px;padding:8px 16px;font-family:var(--brand-mono);font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--brand-ink-faint);background:var(--brand-rail);border-bottom:1px solid var(--brand-edge)}.fa-convo-head::before{content:\"\";width:8px;height:8px;border-radius:999px;background:var(--brand-orange)}.fa-turn{display:grid;grid-template-columns:82px 1fr;gap:14px;padding:13px 16px;border-left:3px solid transparent}.fa-turn+.fa-turn{border-top:1px solid var(--brand-edge)}.fa-turn.fa-bot{border-left-color:var(--brand-orange)}.fa-tag{font-family:var(--brand-mono);font-size:11px;letter-spacing:.03em;text-transform:uppercase;font-weight:600;padding-top:2px}.fa-turn.fa-you .fa-tag{color:var(--brand-orange)}.fa-turn.fa-bot .fa-tag{color:var(--brand-ink-faint)}.fa-body{margin:0}@media (max-width:640px){.fa-turn{grid-template-columns:62px 1fr;gap:10px}}.fa-term{border-radius:16px;overflow:hidden;border:1px solid rgba(255,255,255,.1);margin:1.1rem 0;background:#0b0c0e}.fa-term-body{color:#ccc;padding:14px 16px;overflow-x:auto;white-space:nowrap;font-family:var(--brand-mono-safe);font-size:12.5px;line-height:1.1}.fa-term-banner{display:flex;align-items:flex-end;gap:12px;padding:16px 16px 2px}.fa-term-banner img{display:block;width:165px;max-width:55%;height:auto;margin:0!important}.fa-term-ver{font-family:var(--brand-mono-safe);font-size:12.5px;line-height:1;padding-bottom:3.5px;color:rgba(255,255,255,.45)}.fa-term-banner+.fa-term-body{padding-top:6px}.fa-plate img,.fa-plate>div{border-radius:var(--brand-radius)}.fa-plate img{border:1px solid var(--brand-edge)}html.dark .fa-plate img{background:#fff;padding:14px}html:not(.dark) span[style*=\"rgba(255, 130, 1, 0.1)\"]{background:0 0!important}.fa-arch{margin:1.5rem 0}.fa-arch img{width:100%;height:auto}.fa-arch .fa-arch-d,html.dark .fa-arch .fa-arch-l{display:none}.fa-arch img,html.dark .fa-arch .fa-arch-d{display:block}html:not(.dark) .prose a{border-bottom-color:#9c4f00;border-bottom-width:1.5px}html:not(.dark) .prose a:hover{border-bottom-width:2.5px}body,html{overflow-x:clip!important}"}],"page":{"pagePath":"documentation/concepts/policies/ttl","slug":"/documentation/concepts/policies/ttl","pageMetadata":{"title":"TTL policy","sidebarTitle":"TTL","description":"Automatically destroy a stack and its resources after a set duration.","href":"/documentation/concepts/policies/ttl"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Automatically destroy a stack and its resources after a set duration.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`A TTL (time-to-live) policy destroys a stack and everything in it once its deadline passes. It’s the mechanism for ephemeral infrastructure: dev workspaces, test environments, demos, anything that should clean itself up without someone remembering to run `,_jsx(_components.code,{children:`destroy`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.p,{children:[`The deadline is expressed one of two ways: a `,_jsx(_components.strong,{children:`duration`}),` (`,_jsx(_components.code,{children:`ttl`}),`), measured from when the stack is created, or an `,_jsx(_components.strong,{children:`absolute instant`}),` (`,_jsx(_components.code,{children:`expiresAt`}),`). Either way it counts down in the background: no `,_jsx(_components.code,{children:`apply`}),` is needed to trigger the eventual destroy. Re-applying the stack does not move the deadline; a `,_jsx(_components.code,{children:`ttl`}),` always counts from the stack’s creation, and an `,_jsx(_components.code,{children:`expiresAt`}),` names the instant directly.`]}),`\n`,_jsx(_components.p,{children:`When the deadline passes, formae destroys the stack and all its resources.`}),`\n`,_jsx(Heading,{level:`2`,id:`configuration`,children:`Configuration`}),`\n`,_jsxs(_components.p,{children:[`A TTL policy carries exactly one of `,_jsx(_components.code,{children:`ttl`}),` or `,_jsx(_components.code,{children:`expiresAt`}),`. Declaring both, or neither, fails validation when the forma is evaluated.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ttl`})}),_jsx(_components.td,{children:`Duration`}),_jsxs(_components.td,{children:[`How long the stack should live, measured from its creation, for example `,_jsx(_components.code,{children:`1.h`}),`, `,_jsx(_components.code,{children:`24.h`}),`, `,_jsx(_components.code,{children:`7.d`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`expiresAt`})}),_jsx(_components.td,{children:`String`}),_jsxs(_components.td,{children:[`The instant to destroy the stack at, as an RFC 3339 UTC timestamp, for example `,_jsx(_components.code,{children:`\"2026-09-01T00:00:00Z\"`}),`. Sub-second precision is dropped`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`onDependents`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`\"abort\"`}),` | `,_jsx(_components.code,{children:`\"cascade\"`})]}),_jsxs(_components.td,{children:[`What to do if resources outside the stack depend on it. Defaults to `,_jsx(_components.code,{children:`\"abort\"`})]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`relative-or-absolute`,children:`Relative or absolute?`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`ttl`})}),` fits infrastructure whose lifetime is known at creation: a sandbox that lives for the workday, a test environment that should survive its CI run and no longer. Because it measures from stack creation, attaching a `,_jsx(_components.code,{children:`ttl`}),` to a stack that already exists counts the time the stack has already lived: a `,_jsx(_components.code,{children:`ttl = 1.h`}),` on a three-day-old stack is already expired and the stack is destroyed on the next expiry check.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`expiresAt`})}),` fits deadlines known as a date: the end of a trial, a scheduled teardown, a booking window. It reads the same to every observer, never shifts on re-apply, and is the right form when another system computes the deadline. To destroy an existing stack some time from now, compute the instant and set `,_jsx(_components.code,{children:`expiresAt`}),` rather than attaching a `,_jsx(_components.code,{children:`ttl`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`To move a deadline, re-apply the stack with a new `,_jsx(_components.code,{children:`expiresAt`}),` (or a new `,_jsx(_components.code,{children:`ttl`}),`; the change applies in place, still anchored to creation). To remove one, re-apply the stack in reconcile mode without the policy.`]}),`\n`,_jsx(Heading,{level:`3`,id:`ondependents`,children:`onDependents`}),`\n`,_jsx(_components.p,{children:`When the TTL expires, formae checks whether any resource outside the stack depends on a resource inside it:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`abort`})}),` (default): cancel the destruction. The stack stays intact until the dependency is removed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`cascade`})}),`: delete the dependent resources too, following the dependency chain into other stacks.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`cascade`}),` can delete resources in stacks you didn’t intend to touch, anywhere the dependency chain leads. Use `,_jsx(_components.code,{children:`abort`}),` unless you’re certain nothing outside the stack should survive it.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Inline TTL policy:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`35`,language:`pkl`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`pkl`,children:_jsxs(_components.code,{language:`pkl`,numberOfLines:`35`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`amends`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@formae/forma.pkl\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@formae/formae.pkl\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@aws/aws.pkl\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@aws/logs/loggroup.pkl\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`local`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` devTarget`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Target {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dev-target\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` aws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Config {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` region`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"us-east-1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`forma`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` devTarget`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Stack {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"feature-xyz\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Temporary dev environment for feature XYZ\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` policies`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Listing `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.TTLPolicy {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ttl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.h `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Destroy after 8 hours`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` onDependents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abort\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Don't destroy if other resources depend on it`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` loggroup`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.LogGroup {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"feature-logs\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"feature-xyz\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = devTarget.res`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` logGroupName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/dev/feature-xyz/logs\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` retentionInDays`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Absolute deadline`}),`, for a stack that must be gone at a known instant:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new formae.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` label `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pilot-workshop\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` description `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Workshop environment for the September pilot\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` policies `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Listing`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new formae.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TTLPolicy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` expiresAt `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-09-01T00:00:00Z\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Destroy at this instant`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onDependents `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"abort\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Reusable TTL policy`}),`, shared by every developer’s sandbox stack:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new formae.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` label `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pilot-workshop\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` description `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Workshop environment for the September pilot\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` policies `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Listing`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new formae.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TTLPolicy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` expiresAt `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-09-01T00:00:00Z\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Destroy at this instant`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onDependents `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"abort\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Reusable TTL policy`}),`, shared by every developer’s sandbox stack:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`49`,language:`pkl`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`pkl`,children:_jsxs(_components.code,{language:`pkl`,numberOfLines:`49`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`amends`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@formae/forma.pkl\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@formae/formae.pkl\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@aws/aws.pkl\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@aws/logs/loggroup.pkl\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`local`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ephemeralPolicy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.TTLPolicy {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ephemeral-4h\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ttl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.h`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` onDependents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"cascade\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`local`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` devTarget`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Target {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dev-target\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` aws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Config {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` region`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"us-east-1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`forma`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ephemeralPolicy`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` devTarget`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Stack {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice-dev\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Alice's development environment\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` policies`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Listing `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ ephemeralPolicy.res }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` loggroup`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.LogGroup {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice-logs\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice-dev\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = devTarget.res`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` logGroupName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/dev/alice/logs\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` formae`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.Stack {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bob-dev\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` description`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bob's development environment\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` policies`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Listing `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ ephemeralPolicy.res }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` loggroup`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.LogGroup {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bob-logs\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bob-dev\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = devTarget.res`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` logGroupName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/dev/bob/logs\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`use-cases`,children:`Use cases`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Development environments`}),` that clean themselves up at the end of the workday.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`CI/CD test infrastructure`}),` that disappears once the test run finishes with it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Demo environments`}),` that auto-destroy after the demo window.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cost control`}),`: forgotten resources stop accumulating cost on their own.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`monitoring`,children:`Monitoring`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`formae`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` inventory`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` stacks`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Shows every stack’s attached policies, including TTL and its expiry.`}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/documentation/concepts/policy`,children:`Policy`}),`: inline vs. reusable policies, and how to query them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/documentation/concepts/policies/auto-reconcile`,children:`Auto-reconcile policy`}),`: enforce declared state instead of expiring it. The two can be combined on the same stack.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"languages":{"custom":["/languages/pkl.json"]}},"config":{},"pageMetadata":{"title":"TTL policy","sidebarTitle":"TTL","description":"Automatically destroy a stack and its resources after a set duration.","href":"/documentation/concepts/policies/ttl"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"Configuration","slug":"configuration","depth":2,"children":[{"title":"Relative or absolute?","slug":"relative-or-absolute","depth":3,"children":[]},{"title":"onDependents","slug":"ondependents","depth":3,"children":[]}]},{"title":"Examples","slug":"examples","depth":2,"children":[]},{"title":"Use cases","slug":"use-cases","depth":2,"children":[]},{"title":"Monitoring","slug":"monitoring","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/platform-engineering-labs/4ffdbad5874a08d3/posthog.js"],"subdomain":"platform-engineering-labs","siteName":"formae","title":"TTL policy - formae","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-09T01:01:42.808Z","originalFileLocation":"documentation/concepts/policies/ttl.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Automatically destroy a stack and its resources after a set duration.\">\u003cmeta data-mint-head name=\"application-name\" content=\"formae\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"TTL policy - formae\">\u003cmeta data-mint-head property=\"og:description\" content=\"Automatically destroy a stack and its resources after a set duration.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"formae\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.formae.ai/documentation/concepts/policies/ttl\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://platform-engineering-labs.mintlify.app/_mintlify/api/og/v2?division=Policies\u0026amp;title=TTL+policy\u0026amp;description=Automatically+destroy+a+stack+and+its+resources+after+a+set+duration.\u0026amp;theme=07768c424fb26f39d157f55a\u0026amp;signature=6cb170403010a8efd16a08bc94d3e16ddf941b5861ff6ced41e53905086919b3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"TTL policy - formae\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Automatically destroy a stack and its resources after a set duration.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://platform-engineering-labs.mintlify.app/_mintlify/api/og/v2?division=Policies\u0026amp;title=TTL+policy\u0026amp;description=Automatically+destroy+a+stack+and+its+resources+after+a+set+duration.\u0026amp;theme=07768c424fb26f39d157f55a\u0026amp;signature=6cb170403010a8efd16a08bc94d3e16ddf941b5861ff6ced41e53905086919b3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/platform-engineering-labs/ih3MxqvV1WG3EvUf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"formae\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff8201\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.formae.ai/documentation/concepts/policies/ttl\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/documentation/concepts/policies/ttl.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.formae.ai/#organization\",\"name\":\"formae\",\"url\":\"https://docs.formae.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/platform-engineering-labs/mNa46DBzXSjV0agT/logo/formae-logo-light.png?fit=max\u0026auto=format\u0026n=mNa46DBzXSjV0agT\u0026q=85\u0026s=8563b5284bd2cf259539ff5e7b9d457f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.formae.ai#website\",\"name\":\"formae\",\"url\":\"https://docs.formae.ai\",\"publisher\":{\"@id\":\"https://docs.formae.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.formae.ai/documentation/concepts/policies/ttl#webpage\",\"url\":\"https://docs.formae.ai/documentation/concepts/policies/ttl\",\"name\":\"TTL policy\",\"description\":\"Automatically destroy a stack and its resources after a set duration.\",\"dateModified\":\"2026-09-09T01:01:42.808Z\",\"isPartOf\":{\"@id\":\"https://docs.formae.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.formae.ai/documentation/concepts/policies/ttl#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.formae.ai/documentation/concepts/policies/ttl#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Concepts\",\"item\":\"https://docs.formae.ai/documentation/concepts/forma\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building blocks\",\"item\":\"https://docs.formae.ai/documentation/concepts/forma\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Policies\",\"item\":\"https://docs.formae.ai/documentation/concepts/policy\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"TTL policy\",\"item\":\"https://docs.formae.ai/documentation/concepts/policies/ttl\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.formae.ai/documentation/concepts/policies/ttl#article\",\"headline\":\"TTL policy\",\"name\":\"TTL policy\",\"description\":\"Automatically destroy a stack and its resources after a set duration.\",\"url\":\"https://docs.formae.ai/documentation/concepts/policies/ttl\",\"mainEntityOfPage\":{\"@id\":\"https://docs.formae.ai/documentation/concepts/policies/ttl#webpage\"},\"dateModified\":\"2026-09-09T01:01:42.808Z\",\"publisher\":{\"@id\":\"https://docs.formae.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.formae.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"formae\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"formae","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"formae documentation","href":"/documentation"},{"title":"Quick start","href":"/documentation/get-started/quickstart"},{"title":"Quick start with formae Cloud","href":"/documentation/get-started/quickstart-cloud"},{"title":"Quick start with an AI assistant","href":"/documentation/get-started/quickstart-ai-assistant"},{"title":"Write your first forma","href":"/documentation/get-started/write-your-first-forma"}]},{"group":"Guides","pages":[{"group":"Set up your tools","pages":[{"title":"Set up Pkl in your editor","href":"/documentation/guides/pkl-ide-support"},{"title":"AI assistants","href":"/documentation/guides/ai-coding-assistants"},{"title":"Read tfvars in a forma","href":"/documentation/guides/tfvars"}]},{"group":"Install and run the agent","pages":[{"title":"Install and run the agent","href":"/documentation/guides/install-agent"},{"title":"Install and run the agent on Azure","href":"/documentation/guides/install-agent-azure"},{"title":"Install and run the agent on GCP","href":"/documentation/guides/install-agent-gcp"},{"title":"Install the agent with Docker","href":"/documentation/guides/install-agent-docker"},{"title":"Install the agent with Helm","href":"/documentation/guides/install-agent-helm"},{"title":"Extend the agent image","href":"/documentation/guides/extend-the-agent-image"},{"title":"Observe the agent","href":"/documentation/guides/observe-the-agent"},{"title":"Manage profiles","href":"/documentation/guides/manage-profiles"}]},{"group":"Manage infrastructure","pages":[{"title":"Create a target","href":"/documentation/guides/create-a-target"},{"title":"Explore your infrastructure","href":"/documentation/guides/explore-your-infrastructure"},{"title":"Bring existing resources under management","href":"/documentation/guides/bring-resources-under-management"},{"title":"Everyday changes","href":"/documentation/guides/everyday-changes"},{"title":"Manage stack policies","href":"/documentation/guides/policies"},{"title":"Rename a resource","href":"/documentation/guides/rename-a-resource"},{"title":"Incidents and recovery","href":"/documentation/guides/incidents-and-recovery"},{"title":"Troubleshoot a failed command","href":"/documentation/guides/troubleshoot-a-failed-command"},{"title":"Repair duplicated map keys","href":"/documentation/guides/repair-duplicated-map-keys"},{"title":"Cancel a running command","href":"/documentation/guides/cancel-a-running-command"},{"title":"Deal with out-of-band changes","href":"/documentation/guides/deal-with-out-of-band-changes"},{"title":"Build self-service infrastructure","href":"/documentation/guides/build-self-service-infrastructure"},{"title":"Reuse infrastructure with modules","href":"/documentation/guides/reuse-with-modules"},{"title":"Run formae in CI/CD","href":"/documentation/guides/cicd"}]}]},{"group":"Concepts","pages":[{"group":"Building blocks","pages":[{"title":"Forma","href":"/documentation/concepts/forma"},{"title":"Stack","href":"/documentation/concepts/stack"},{"title":"Target","href":"/documentation/concepts/target"},{"title":"Resources","href":"/documentation/concepts/resources"},{"title":"Label","href":"/documentation/concepts/label"},{"title":"Properties","href":"/documentation/concepts/properties"},{"title":"Resolvable","href":"/documentation/concepts/resolvable"},{"title":"Values","href":"/documentation/concepts/values"},{"title":"Secrets and generated credentials","href":"/documentation/concepts/secrets"},{"group":"Policies","pages":[{"title":"Policy","sidebarTitle":"Overview","description":"A policy is a lifecycle rule you attach to a stack: automatic cleanup after a duration, or automatic enforcement of declared state.","href":"/documentation/concepts/policy"},{"title":"TTL policy","sidebarTitle":"TTL","href":"/documentation/concepts/policies/ttl"},{"title":"Auto-reconcile policy","sidebarTitle":"Auto-reconcile","description":"Automatically re-apply a stack's declared state at a fixed interval, undoing drift.","href":"/documentation/concepts/policies/auto-reconcile"}]}]},{"group":"How formae works","pages":[{"title":"Architecture","href":"/documentation/concepts/architecture"},{"title":"Plugins","href":"/documentation/concepts/plugin"},{"title":"Ways to work with formae","href":"/documentation/concepts/ways-to-work"},{"title":"Apply modes","href":"/documentation/concepts/apply-modes"},{"title":"Synchronization","href":"/documentation/concepts/synchronization"},{"title":"Discovery","href":"/documentation/concepts/discovery"}]}]},{"group":"Reference","pages":[{"group":"CLI","pages":[{"title":"CLI reference","href":"/documentation/reference/cli"},{"title":"formae apply","href":"/documentation/reference/cli/apply"},{"title":"formae destroy","href":"/documentation/reference/cli/destroy"},{"title":"formae status","href":"/documentation/reference/cli/status"},{"title":"formae command","href":"/documentation/reference/cli/command"},{"title":"formae cancel","href":"/documentation/reference/cli/cancel"},{"title":"formae connect","href":"/documentation/reference/cli/connect"},{"title":"formae inventory","href":"/documentation/reference/cli/inventory"},{"title":"formae extract","href":"/documentation/reference/cli/extract"},{"title":"formae eval","href":"/documentation/reference/cli/eval"},{"title":"formae project","href":"/documentation/reference/cli/project"},{"title":"formae plugin","href":"/documentation/reference/cli/plugin"},{"title":"formae profile","href":"/documentation/reference/cli/profile"},{"title":"formae agent","href":"/documentation/reference/cli/agent"},{"title":"formae update","href":"/documentation/reference/cli/update"},{"title":"formae clean","href":"/documentation/reference/cli/clean"}]},{"title":"Configuration","href":"/documentation/reference/configuration"},{"title":"CLI themes","href":"/documentation/reference/themes"},{"title":"Security and networking","href":"/documentation/reference/security-and-networking"},{"title":"Pkl cheatsheet","href":"/documentation/reference/pkl-cheatsheet"},{"group":"Cloud providers","pages":[{"group":"AWS","pages":[{"title":"AWS configuration","href":"/documentation/reference/providers/aws/configuration"},{"group":"Common patterns","pages":[{"title":"Static website (S3 + CloudFront)","href":"/documentation/reference/providers/aws/patterns/static-website-s3-cloudfront"},{"title":"Base VPC networking","href":"/documentation/reference/providers/aws/patterns/base-vpc-networking"},{"title":"CloudFront edge","href":"/documentation/reference/providers/aws/patterns/cloudfront-edge"},{"title":"A self-service database","href":"/documentation/reference/providers/aws/patterns/a-self-service-database"},{"title":"ML platform","href":"/documentation/reference/providers/aws/patterns/ml-platform"},{"title":"Deploy a Lambda","href":"/documentation/reference/providers/aws/patterns/deploy-a-lambda"},{"title":"Deploy an ECS service","href":"/documentation/reference/providers/aws/patterns/deploy-an-ecs-service"},{"title":"Bookstore on EKS","href":"/documentation/reference/providers/aws/patterns/bookstore-on-eks"}]},{"title":"AWS supported resources","href":"/documentation/reference/providers/aws/supported-resources"}]},{"group":"Azure","pages":[{"title":"Azure configuration","href":"/documentation/reference/providers/azure/configuration"},{"group":"Common patterns","pages":[{"title":"Lay down base networking","href":"/documentation/reference/providers/azure/patterns/lay-down-base-networking"},{"title":"Run a PostgreSQL database","href":"/documentation/reference/providers/azure/patterns/run-a-postgresql-database"},{"title":"Provision an AKS cluster","href":"/documentation/reference/providers/azure/patterns/provision-an-aks-cluster"},{"title":"Deploy a virtual machine","href":"/documentation/reference/providers/azure/patterns/deploy-a-virtual-machine"},{"title":"Deploy the bookstore on AKS","href":"/documentation/reference/providers/azure/patterns/deploy-the-bookstore-on-aks"}]},{"title":"Azure supported resources","href":"/documentation/reference/providers/azure/supported-resources"}]},{"group":"GCP","pages":[{"title":"GCP configuration","href":"/documentation/reference/providers/gcp/configuration"},{"group":"Common patterns","pages":[{"title":"Deploy base VPC networking","href":"/documentation/reference/providers/gcp/patterns/deploy-base-vpc-networking"},{"title":"Deploy an HTTP(S) load balancer","href":"/documentation/reference/providers/gcp/patterns/deploy-an-https-load-balancer"},{"title":"Deploy the bookstore on GKE","href":"/documentation/reference/providers/gcp/patterns/deploy-the-bookstore-on-gke"}]},{"title":"GCP supported resources","href":"/documentation/reference/providers/gcp/supported-resources"}]},{"group":"OCI","pages":[{"title":"OCI configuration","href":"/documentation/reference/providers/oci/configuration"},{"group":"Common patterns","pages":[{"title":"Deploy base VCN networking","href":"/documentation/reference/providers/oci/patterns/deploy-base-vcn-networking"},{"title":"Deploy an OKE Kubernetes cluster","href":"/documentation/reference/providers/oci/patterns/deploy-an-oke-kubernetes-cluster"}]},{"title":"OCI supported resources","href":"/documentation/reference/providers/oci/supported-resources"}]},{"group":"Kubernetes","pages":[{"title":"Kubernetes configuration","href":"/documentation/reference/providers/kubernetes/configuration"},{"title":"Kubernetes with installation OIDC","href":"/documentation/reference/providers/kubernetes/oidc"},{"group":"Common patterns","pages":[{"title":"Deploy a Helm chart","href":"/documentation/reference/providers/kubernetes/patterns/deploy-a-helm-chart"},{"title":"Deploy the bookstore webapp","href":"/documentation/reference/providers/kubernetes/patterns/deploy-the-bookstore-webapp"},{"title":"Deploy a Crossplane control plane","href":"/documentation/reference/providers/kubernetes/patterns/deploy-a-crossplane-control-plane"},{"title":"Deploy the LGTM observability stack","href":"/documentation/reference/providers/kubernetes/patterns/deploy-the-lgtm-observability-stack"}]},{"title":"Kubernetes supported resources","href":"/documentation/reference/providers/kubernetes/supported-resources"}]}]},{"title":"Plugin catalog","href":"/documentation/reference/plugin-catalog"},{"title":"Release notes","href":"/documentation/reference/release-notes"}]}]},{"tab":"Plugin development","pages":[{"title":"Plugin development","href":"/plugin-development"}]}]},"title":"TTL policy - formae","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["10e4515597"],"chunks":["BannerMarkdown-cfwQA_n9.js","dist-2LoAhjKH.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-DZLdJUrt.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}