Problem
When attempting to connect a Version Control System (VCS) provider such as GitHub, GitLab, or Bitbucket to HCP Terraform, the integration may fail if webhooks are not used or are blocked by network policies.
Cause
HCP Terraform requires webhooks for all VCS integrations. This is a mandatory component of the integration design that enables real-time updates and synchronization between HCP Terraform and the connected VCS repository.
HCP Terraform depends on webhooks to perform critical operations, including:
- Triggering Runs Automatically: Webhooks enable HCP Terraform to detect changes in the repository, such as new commits, branch updates, or pull requests, and automatically trigger Terraform runs.
- Maintaining Synchronization: Webhooks ensure that the state of the VCS repository is always accurately reflected in HCP Terraform, which reduces the risk of configuration drift.
- Event-Driven Automation: By leveraging webhooks, HCP Terraform can respond dynamically to events in the VCS, enhancing the automation of Infrastructure as Code (IaC) processes.
Solution
It is not possible to connect a VCS provider to HCP Terraform without using webhooks. To establish a successful connection, you must ensure that your VCS provider can send webhook notifications to HCP Terraform and that any intermediary network configurations, such as firewalls, allow this traffic.
Additional Information
For more detailed instructions on connecting your specific VCS provider, refer to the official HCP Terraform documentation on VCS integration.