-
Notifications
You must be signed in to change notification settings - Fork 52
/
repos.tf
43 lines (37 loc) · 1.04 KB
/
repos.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
terraform {
backend "s3" {
bucket = "<TF_STATE_BUCKET>"
key = "terraform/github/tfstate.tf"
region = "<AWS_DEFAULT_REGION>"
encrypt = true
}
required_providers {
github = {
source = "integrations/github"
version = "4.26.0"
}
}
}
module "gitops" {
source = "./modules/repository"
repo_name = "gitops"
archive_on_destroy = false
auto_init = false # set to false if importing an existing repository
team_developers_id = github_team.developers.id
team_admins_id = github_team.admins.id
}
resource "github_repository_webhook" "gitops_atlantis_webhook" {
repository = module.gitops.repo_name
configuration {
url = "https://atlantis.<AWS_HOSTED_ZONE_NAME>/events"
content_type = "json"
insecure_ssl = false
secret = var.atlantis_repo_webhook_secret
}
active = true
events = ["pull_request_review", "push", "issue_comment", "pull_request"]
}
variable "atlantis_repo_webhook_secret" {
type = string
default = ""
}