Skip to content

apply

Run the Terraform plan/apply flow against the generated configuration.

  • Verifies you are in a grada project (terraform/main.tf must exist), exiting otherwise, so apply never runs against the wrong directory.
  • Renders an infrastructure preview from your Terraform config and framework detection: a Fixed Baseline monthly figure with per-service breakdown, one topology entry per provisioned add addon (collapsing to a single Addons (N) line when three or more are active), and a one-line Usage-based (N addons) summary of metered billing drivers (shown only when usage-billed addons are present). With --dry-run it stops there and provisions nothing.
  • Otherwise runs terraform init -upgrade followed by terraform apply -auto-approve in terraform/, streaming progress, then prints the live URLs from the Terraform outputs (cloudfront_url and alb_direct_url, api_gateway_url on --target lambda, or site_url on --target static) plus the git push command that deploys your app and clears the initial 503.
  • On --target lambda projects, ensures the ECR repository exists first and seeds a minimal placeholder image under :latest when 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 --headless flag), 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-approve and --headless accept the recovery without prompting.
  • If the environment is asleep (a .grada/sleep-state.json entry exists), warns you to run wake first — applying would start tasks against a stopped database.
  • On the known GitHub OIDC provider conflict (EntityAlreadyExists for token.actions.githubusercontent.com), tells you to set create_oidc_provider = false in terraform/oidc.tf and re-run; other failures print the Terraform error and the manual cd terraform && terraform apply fallback.
Terminal window
npx grada-run apply
npx grada-run apply --dry-run
npx 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.