|
| 1 | +--- |
| 2 | +title: "env0 change integration" |
| 3 | +description: "Sync environment deploys and destroys from an env0 webhook notification target to Flashduty On-call as change events correlated with alerts and incidents." |
| 4 | +keywords: ["change integration", "env0", "env zero", "Deployment", "Destroy", "Terraform", "Webhook"] |
| 5 | +--- |
| 6 | + |
| 7 | +<Tip>**Plan requirement**: This feature requires the On-call Standard plan or above. [Learn more](https://flashcat.cloud/flashduty/price/)</Tip> |
| 8 | + |
| 9 | +Use an env0 webhook notification target to sync environment deploys and destroys to Flashduty On-call. Each env0 run (one deployment log) becomes one Flashduty change; every state of the run, from started and waiting for approval to resumed, succeeded, failed or canceled, updates that same change. |
| 10 | + |
| 11 | +<div className="hide"> |
| 12 | + |
| 13 | +## In Flashduty On-call |
| 14 | +--- |
| 15 | + |
| 16 | +1. In the Flashduty console, go to **Integration Center → Change Events** |
| 17 | +2. Select **env0** and enter an integration name |
| 18 | +3. To assign changes to specific channels, configure rules in the integration's **Routing** based on labels such as `project` or `environment` |
| 19 | +4. Click **Save** and copy the generated **Push URL** |
| 20 | + |
| 21 | +</div> |
| 22 | + |
| 23 | +## In env0 |
| 24 | +--- |
| 25 | + |
| 26 | +<Steps> |
| 27 | +<Step title="Add a webhook notification target"> |
| 28 | + |
| 29 | +This needs organization admin permission. Go to **Organization Settings → Notifications** and click **Add Notification Target**: |
| 30 | + |
| 31 | +1. **Name**: any name, unique within the organization |
| 32 | +2. **Type**: select **Webhook** |
| 33 | +3. **URL**: paste the full Push URL of the Flashduty integration (env0 requires HTTPS) |
| 34 | +4. **Secret**: leave empty. Flashduty authenticates with the `integration_key` in the Push URL and does not check `x-env0-signature` |
| 35 | + |
| 36 | +Use **Test endpoint → Send test event** to check connectivity: Flashduty returns success, but the test event does not create a change. |
| 37 | + |
| 38 | +</Step> |
| 39 | + |
| 40 | +<Step title="Select events in a project"> |
| 41 | + |
| 42 | +This needs project admin permission. Go to **Project Settings → Notifications**, click the edit icon next to the notification target and select: |
| 43 | + |
| 44 | +- **Deployment started**, **Deployment waiting for user**, **Deployment resumed**, **Deployment cancelled** |
| 45 | +- **Deploy succeeded**, **Deploy failed** |
| 46 | +- To record destroys as well, **Destroy started**, **Destroy resumed**, **Destroy succeeded**, **Destroy failed** |
| 47 | + |
| 48 | +Click **Save**. Configure each project separately. Other events (drift, budget, TTL auto-destroy, PR plan failures) are not changes: Flashduty returns success for them but creates no change. |
| 49 | + |
| 50 | +</Step> |
| 51 | +</Steps> |
| 52 | + |
| 53 | +env0 does not retry a failed webhook delivery, and its delivery timeout is 10 seconds. |
| 54 | + |
| 55 | +## What one change is |
| 56 | +--- |
| 57 | + |
| 58 | +| env0 object | Change key (change_key) | Notes | |
| 59 | +|---|---|---| |
| 60 | +| One deploy or destroy run (deployment log) | `data.deploymentLog.id` | Every event of one run updates the same change; two runs of the same environment are two changes | |
| 61 | + |
| 62 | +The key is not the environment ID: one environment has many runs, each with its own deployment log. |
| 63 | + |
| 64 | +## Status mapping |
| 65 | +--- |
| 66 | + |
| 67 | +| env0 event | Flashduty change status | |
| 68 | +|---|---| |
| 69 | +| `com.env0.deploy.started` / `com.env0.destroy.started` | Processing | |
| 70 | +| `com.env0.deployment.waiting_for_user` (waiting for approval) | Planned | |
| 71 | +| `com.env0.deploy.resumed` / `com.env0.destroy.resumed` (approved, running again) | Processing | |
| 72 | +| `com.env0.deploy.succeeded` / `com.env0.destroy.succeeded` | Done | |
| 73 | +| `com.env0.deploy.failed` / `com.env0.destroy.failed` | Failed | |
| 74 | +| `com.env0.deployment.cancelled` | Canceled | |
| 75 | + |
| 76 | +Done, Failed and Canceled are end states; Flashduty records the change's end time. |
| 77 | + |
| 78 | +These deliveries return success and create no change: `com.env0.webhook.test`, `com.env0.pr_plan.failed`, `com.env0.environment.*`, `com.env0.drift.*`, `com.env0.budget.exceeded`, and any other event type that is not a deploy or destroy run. |
| 79 | + |
| 80 | +## Change content |
| 81 | +--- |
| 82 | + |
| 83 | +| Field | Value | |
| 84 | +|---|---| |
| 85 | +| Title | `<project> / <environment>: deploy` or `<project> / <environment>: destroy`; the environment ID stands in for a missing name | |
| 86 | +| Description | The run's comment (`deploymentLog.comment`), empty if none | |
| 87 | +| Link | The run's page in env0; the environment page, then the project page, when it is missing | |
| 88 | + |
| 89 | +Labels are available for routing and for filtering the change list: |
| 90 | + |
| 91 | +| Label | Value | |
| 92 | +|---|---| |
| 93 | +| `project` / `project_id` | Project name / ID | |
| 94 | +| `environment` / `environment_id` | Environment name / ID | |
| 95 | +| `deployment_id` | Deployment log ID of the run | |
| 96 | +| `operation` | `deploy` or `destroy` | |
| 97 | +| `state` | The latest env0 event, for example `deploy.succeeded` | |
| 98 | +| `repo` / `ref` | The template's repository URL / branch or tag | |
| 99 | +| `actor` | Name of the user who started the run; absent for scheduled or automatic runs | |
| 100 | + |
| 101 | +## FAQ |
| 102 | +--- |
| 103 | + |
| 104 | +<AccordionGroup> |
| 105 | +<Accordion title="Does a repeated delivery create a duplicate record?"> |
| 106 | + |
| 107 | +No. Flashduty uses the time carried by the env0 event, so the same event at the same time is recorded once; an older state that arrives late does not overwrite a finished change. |
| 108 | + |
| 109 | +</Accordion> |
| 110 | + |
| 111 | +<Accordion title="Why is there no Planned status for my environment?"> |
| 112 | + |
| 113 | +Planned appears only when env0 sends `deployment.waiting_for_user` (the run waits for approval). A run that needs no approval goes from Processing straight to Done, Failed or Canceled. |
| 114 | + |
| 115 | +</Accordion> |
| 116 | + |
| 117 | +<Accordion title="A delivery returns an InvalidParameter error?"> |
| 118 | + |
| 119 | +- `unsupported type`: a deployment-family event Flashduty does not support yet arrived. Select only the events listed above, or contact us |
| 120 | +- `data.deploymentLog.id is missing`: the body is incomplete; make sure it comes from a native env0 webhook notification target |
| 121 | + |
| 122 | +env0 does not retry, and the response of a failed delivery is visible on env0's test page. |
| 123 | + |
| 124 | +</Accordion> |
| 125 | +</AccordionGroup> |
0 commit comments