Schedule Terraform deployments, create approval workflows, and set up automated pipelines for infrastructure changes.
Your team wants to:
Deploy automatically on a schedule (e.g., nightly staging updates).
nightly-staging-deploySelect Schedule trigger and set the cron expression:
| Schedule | Cron Expression |
|---|---|
| Every night at 2 AM | 0 2 * * * |
| Every Monday at 9 AM | 0 9 * * 1 |
| Every hour | 0 * * * * |
| First of month | 0 0 1 * * |
┌───────────────────────────────────────────────────────────────┐
│ Trigger: Schedule (Daily at 2 AM UTC) │
└───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Step 1: Terraform Plan │
│ Project: staging-infrastructure │
│ Action: Plan │
└───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Step 2: Terraform Apply │
│ Project: staging-infrastructure │
│ Action: Apply │
│ Condition: Only if plan has changes │
└───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Step 3: Notify Slack │
│ Channel: #infrastructure │
│ Message: "Staging deployment complete: {{ result }}" │
└───────────────────────────────────────────────────────────────┘
Click Save & Enable to activate the workflow.
Require human approval before deploying to production.
production-deploy┌───────────────────────────────────────────────────────────────┐
│ Trigger: Manual or GitHub (PR merged to main) │
└───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Step 1: Terraform Plan │
│ Project: production-infrastructure │
└───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Step 2: Request Approval │
│ Approvers: @platform-team │
│ Notify via: Slack #prod-approvals │
│ Timeout: 4 hours │
│ Include: Plan output, cost estimate │
└───────────────────────────────────────────────────────────────┘
│
┌─────────┴─────────┐
│ │
▼ ▼
Approved Rejected/Timeout
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ Step 3: Apply │ │ Notify: Deployment │
│ │ │ cancelled │
└──────────────────────┘ └──────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Step 4: Notify Success │
│ Channel: #infrastructure │
└───────────────────────────────────────────────────────────────┘
When the workflow reaches the approval step:
Project: production-infrastructure
Requested by: jane@company.com
Changes: 2 to add, 1 to change, 0 to destroy
Cost Impact: +$45.00/month
Deploy automatically when specific events occur.
| Trigger | Use Case |
|---|---|
| GitHub PR Merged | Deploy when code reaches main branch |
| Webhook | Trigger from external systems (CI/CD, Slack) |
| Manual | On-demand deployment button |
| Another Workflow | Chain workflows together |
| Drift Detected | Auto-remediate when drift is found |
┌───────────────────────────────────────────────────────────────┐
│ Trigger: GitHub │
│ Event: Pull Request Merged │
│ Branch: main │
│ Path Filter: terraform/** │
└───────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────┐
│ Condition: Check Environment │
│ If: PR labels contain "production" │
│ → Go to Production Deploy Path │
│ Else: │
│ → Go to Staging Deploy Path │
└───────────────────────────────────────────────────────────────┘
Add notifications to any workflow step:
#infrastructure| Variable | Value |
|---|---|
{{ workflow.name }} | Name of the workflow |
{{ trigger.user }} | Who triggered (or "scheduled") |
{{ steps.plan.changes }} | Number of changes in plan |
{{ steps.apply.status }} | Success/Failed |
{{ steps.apply.duration }} | How long apply took |
{{ project.name }} | Project name |
{{ workflow.name }} completed!
Triggered by: {{ trigger.user }}
Project: {{ project.name }}
Status: {{ steps.apply.status }}
Changes: {{ steps.plan.changes }}
Duration: {{ steps.apply.duration }}
View details: {{ workflow.url }}
| Status | Meaning |
|---|---|
| Running | Currently executing |
| Waiting | Waiting for approval |
| Succeeded | All steps completed successfully |
| Failed | A step failed (click for details) |
| Cancelled | Manually stopped or timeout |