-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathmain.tf
48 lines (40 loc) · 1.12 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
terraform {
required_version = ">= 1.7.0"
required_providers {
flux = {
source = "fluxcd/flux"
version = ">= 1.2"
}
github = {
source = "integrations/github"
version = ">= 6.1"
}
kind = {
source = "tehcyx/kind"
version = ">= 0.4"
}
}
}
# ==========================================
# Construct KinD cluster
# ==========================================
resource "kind_cluster" "this" {
name = "flux-e2e"
}
# ==========================================
# Initialise a Github project
# ==========================================
resource "github_repository" "this" {
name = var.github_repository
description = var.github_repository
visibility = "private"
auto_init = true # This is extremely important as flux_bootstrap_git will not work without a repository that has been initialised
}
# ==========================================
# Bootstrap KinD cluster
# ==========================================
resource "flux_bootstrap_git" "this" {
depends_on = [github_repository.this]
embedded_manifests = true
path = "clusters/my-cluster"
}