aboutsummaryrefslogtreecommitdiff
path: root/ops/github/repositories.tf
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-10-09 13:18:41 -0700
committerFranck Cuny <franck@fcuny.net>2022-10-09 13:18:41 -0700
commitd0170b6fb3409e5697a2e4c8513cd498feaa7cc9 (patch)
treee9999bbace61cd30b9b9ddcb2c9cfc6099d54de7 /ops/github/repositories.tf
parentfeat(ops/github): add the repository twitter-backup (diff)
downloadinfra-d0170b6fb3409e5697a2e4c8513cd498feaa7cc9.tar.gz
ref(ops/github): simplify the configuration
Move all the repositories in a YAML file, instead of declaring each repository. This will simplify the management as I'll be introducing more resources to manage my repositories.
Diffstat (limited to '')
-rw-r--r--ops/github/repositories.tf21
1 files changed, 21 insertions, 0 deletions
diff --git a/ops/github/repositories.tf b/ops/github/repositories.tf
new file mode 100644
index 0000000..506f0dd
--- /dev/null
+++ b/ops/github/repositories.tf
@@ -0,0 +1,21 @@
+locals {
+ repositories = yamldecode(file("repositories.yaml"))
+}
+
+resource "github_repository" "repos" {
+ for_each = local.repositories
+
+ name = try(each.value.name, each.key)
+ visibility = each.value.visibility
+ archived = each.value.archived
+ description = try(each.value.description, null)
+ has_downloads = false
+ has_issues = try(each.value.has_issues, true)
+ has_projects = false
+ has_wiki = false
+ allow_merge_commit = false
+ allow_squash_merge = true
+ allow_rebase_merge = true
+ vulnerability_alerts = try(each.value.vulnerability_alerts, false)
+ delete_branch_on_merge = try(each.value.vulnerability_alerts, false)
+}