This repository has been archived by the owner on Jan 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tf
31 lines (27 loc) · 1.43 KB
/
main.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
resource "github_repository" "new-repository" {
name = "${var.repo["name"]}"
description = "${var.repo["description"]}"
private = "${lookup(var.repo, "private", false)}"
auto_init = "${lookup(var.repo, "auto_init", true)}"
gitignore_template = "${var.repo["gitignore_template"]}"
license_template = "${var.repo["license"]}"
homepage_url = "${lookup(var.repo, "homepage_url", "")}"
has_issues = "${lookup(var.repo, "enable_issues", true)}"
has_wiki = "${lookup(var.repo, "enable_wiki", true)}"
has_downloads = "${lookup(var.repo, "enable_download", true)}"
allow_merge_commit = "${lookup(var.repo, "enable_merge_commit", true)}"
allow_squash_merge = "${lookup(var.repo, "enable_squash_merge", true)}"
allow_rebase_merge = "${lookup(var.repo, "enable_rebase_merge", true)}"
}
resource "github_repository_webhook" "new-repository-webhook" {
count = "${length(var.webhook)}"
repository = "${github_repository.new-repository.name}"
name = "${lookup(var.webhook[count.index], "name")}"
configuration {
url = "${lookup(var.webhook[count.index], "url")}"
content_type = "${lookup(var.webhook[count.index], "content_type")}"
insecure_ssl = "${lookup(var.webhook[count.index], "insecure_ssl")}"
}
active = "${lookup(var.webhook[count.index], "enable", true)}"
events = "${split(",", lookup(var.webhook[count.index], "events"))}"
}