Using a Terraform Cloud Run Task Webhook trigger in Blink
You can trigger Blink Automations with events from Terraform using Terraform Run Tasks.
You cannot create a Run Task unless the Automation is published and active, and has at least one step.
Creating a Terraform Cloud Run Task Webhook trigger in Blink
The integration generates a unique endpoint URL in Blink. You will use this URL as the Webhook URL when you create a Run Task in Terraform Cloud.
From your Blink workspace, click Add Automation.
Enter Automation name and select in which Pack to place the new Automation.
In Type of trigger, select Event-based Automation.
Select Terraform Cloud, Run Task Webhook Event > Continue. The Trigger setup dialog box opens.
Copy the Webhook URL. You need this to create a Run task in Terraform Cloud.
Creating a Run Task in Terraform Cloud
In Terraform cloud, go to Workspaces > Select a workspace > Settings > Run tasks.
Click Create a new Run Task. Create a Run Task page opens.
Enter all values on the Create a Run Task page.
- Select enable Run task will run across all workspaces.
- Name: Select a meaningful name.
- Endpoint URL: Paste the copied Blink Webhook URL.
- Description: Describe what the Run Task is (optional).
Click Create run task. Run Tasks opens.
Under *Available Run Tasks, next to relevant Run Task, click +. Associated Run Task** page opens.
Under Run stage, select your desired run stage. The Blink integration works with all run stages. Under Enforcement level, select Advisory or Mandatory according to your preference.
Adding a Run Task Callback in a Blink automation
In order for the Run Task to finish successfully, the Blink automation must return a callback request to Terraform Cloud. This can be done using the Terraform Cloud Run Task Callback action.
- In the Blink platform, in the Edit page of your Automation, click the empty space under Steps > Action > Run Task Callback.
- In the Run Task CallbackCallback URL and Access Token: It is recommended to leave the default values pre-defined in this action. Enter the rest of the parameters by your preference.
- In the top-right corner of the canvas, Publish the Automation.