apply
Run the Terraform plan/apply flow against the generated configuration.
What it does
Section titled “What it does”- Verifies you are in a grada project (
terraform/main.tfmust exist), exiting otherwise, soapplynever runs against the wrong directory. - Renders an infrastructure preview from your Terraform config and framework detection: a
Fixed Baselinemonthly figure with per-service breakdown, one topology entry per provisionedaddaddon (collapsing to a singleAddons (N)line when three or more are active), and a one-lineUsage-based (N addons)summary of metered billing drivers (shown only when usage-billed addons are present). With--dry-runit stops there and provisions nothing. - Otherwise runs
terraform init -upgradefollowed byterraform apply -auto-approveinterraform/, streaming progress, then prints the live URLs from the Terraform outputs (cloudfront_urlandalb_direct_url,api_gateway_urlon--target lambda, orsite_urlon--target static) plus thegit pushcommand that deploys your app and clears the initial 503. - On
--target lambdaprojects, ensures the ECR repository exists first and seeds a minimal placeholder image under:latestwhen nothing has been pushed yet (Lambda rejects empty repositories), so Day-0 provisioning succeeds before the first code push. - Asks for confirmation after the preview; declining aborts without provisioning anything. With
--auto-approve(or the global--headlessflag), the preview still renders but provisioning proceeds without prompting. - If the S3 state bucket is missing (e.g. deleted manually), offers to recreate it and resume automatically instead of failing;
--auto-approveand--headlessaccept the recovery without prompting. - If the environment is asleep (a
.grada/sleep-state.jsonentry exists), warns you to runwakefirst — applying would start tasks against a stopped database. - On the known GitHub OIDC provider conflict (
EntityAlreadyExistsfortoken.actions.githubusercontent.com), tells you to setcreate_oidc_provider = falseinterraform/oidc.tfand re-run; other failures print the Terraform error and the manualcd terraform && terraform applyfallback.
npx grada-run applynpx grada-run apply --dry-runnpx grada-run apply --auto-approve| Flag | Description |
|---|---|
--dry-run |
Render a preview of the planned changes without applying them. |
--auto-approve |
Skip the post-preview confirmation (and the state-bucket recovery prompt) for non-interactive runs. |
--headless |
Global automation flag; implies --auto-approve for this command. |
apply shells out to the terraform binary in your generated terraform/ directory and streams progress while it runs.