diff --git a/modules/github-repository-webhook/README.md b/modules/github-repository-webhook/README.md
index bce417b9..5eae4e9c 100644
--- a/modules/github-repository-webhook/README.md
+++ b/modules/github-repository-webhook/README.md
@@ -30,6 +30,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| [atlantis\_allowed\_repo\_names](#input\_atlantis\_allowed\_repo\_names) | List of names of repositories which belong to the owner specified in `github_owner` | `list(string)` | n/a | yes |
| [create\_github\_repository\_webhook](#input\_create\_github\_repository\_webhook) | Whether to create Github repository webhook for Atlantis | `bool` | `true` | no |
+| [github\_base\_url](#input\_github\_base\_url) | Github base URL to use when creating webhook (when using GitHub Enterprise) | `string` | `null` | no |
| [github\_owner](#input\_github\_owner) | Github owner to use when creating webhook | `string` | `""` | no |
| [github\_token](#input\_github\_token) | Github token to use when creating webhook | `string` | `""` | no |
| [webhook\_secret](#input\_webhook\_secret) | Webhook secret | `string` | `""` | no |
diff --git a/modules/github-repository-webhook/main.tf b/modules/github-repository-webhook/main.tf
index 2ddbaddf..9af7660c 100644
--- a/modules/github-repository-webhook/main.tf
+++ b/modules/github-repository-webhook/main.tf
@@ -1,6 +1,7 @@
provider "github" {
- token = var.github_token
- owner = var.github_owner
+ base_url = var.github_base_url
+ token = var.github_token
+ owner = var.github_owner
}
resource "github_repository_webhook" "this" {
diff --git a/modules/github-repository-webhook/variables.tf b/modules/github-repository-webhook/variables.tf
index 709aab58..649ad245 100644
--- a/modules/github-repository-webhook/variables.tf
+++ b/modules/github-repository-webhook/variables.tf
@@ -4,6 +4,12 @@ variable "create_github_repository_webhook" {
default = true
}
+variable "github_base_url" {
+ description = "Github base URL to use when creating webhook (when using GitHub Enterprise)"
+ type = string
+ default = null
+}
+
variable "github_token" {
description = "Github token to use when creating webhook"
type = string