Optional resources
Not every customer needs every part of your stack. Resources can now be gated
on a boolean deployment input with .enabled(), so the person installing
decides what gets provisioned:
const inputs = alien.inputs({
cacheEnabled: alien.boolean({
providedBy: "deployer",
required: true,
label: "Enable the cache",
description: "Provision a key-value store for response caching.",
}),
})
const cache = new alien.Kv("cache")
.enabled(inputs.cacheEnabled)
.build()A disabled resource isn't hidden — it doesn't exist. Nothing is provisioned, no IAM grants are emitted for it, and it's absent from the generated CloudFormation and Terraform. The install a security team reviews contains exactly what that customer turned on.
The gate follows the resource's lifecycle. For frozen resources, the answer is part of the install and fixed for the deployment's lifetime. For live resources, it can change later: enabling provisions the resource, disabling deletes it — data included, deliberately, because that's what "turn this off" means to the person paying for it.
- Real absence — disabled means no infrastructure, no permissions, no cost
- Per-customer stacks — one
alien.ts, different footprints per deployment - Asked like any input — the toggle shows up in the dashboard, portal, CLI, and IaC