-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtfe.tf
96 lines (72 loc) · 2.11 KB
/
tfe.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# create kubernetes namespace
resource "kubernetes_namespace" "tfe" {
metadata {
name = "tfe"
}
lifecycle{
ignore_changes = [
metadata.0.annotations["openshift.io/sa.scc.mcs"],
metadata.0.annotations["openshift.io/sa.scc.supplemental-groups"],
metadata.0.annotations["openshift.io/sa.scc.uid-range"],
metadata.0.labels["olm.operatorgroup.uid/78dff708-1437-40e8-90af-eccf84e06ae7"],
]
}
}
resource "kubernetes_manifest" "pg-operator" {
depends_on = [ kubernetes_namespace.tfe ]
manifest = provider::kubernetes::manifest_decode(local.pg_subscription)
}
resource "kubernetes_manifest" "postgres-operatorgroup" {
depends_on = [ kubernetes_namespace.tfe ]
manifest = provider::kubernetes::manifest_decode(local.pg_operatorgroup)
}
resource "kubernetes_manifest" "pg-cluster" {
depends_on = [ kubernetes_manifest.pg-operator ]
manifest = provider::kubernetes::manifest_decode(local.pg_cluster)
}
resource "kubernetes_manifest" "s3bucket-tfeapp" {
depends_on = [ kubernetes_namespace.tfe ]
manifest = provider::kubernetes::manifest_decode(local.tfe_s3bucket_tfeapp)
}
resource "kubernetes_secret" "terraform_enterprise" {
metadata {
name = "terraform-enterprise"
namespace = "tfe"
}
type = "kubernetes.io/dockerconfigjson"
data = {
".dockerconfigjson" = jsonencode({
auths = {
"images.releases.hashicorp.com" = {
username = "terraform"
password = var.tfe_license
auth = base64encode("terraform:${var.tfe_license}")
}
}
})
}
}
removed {
from = helm_release.tfe
lifecycle {
destroy = false
}
}
resource "kubernetes_secret" "operator" {
metadata {
name = "hcp-terraform-operator"
namespace = "tfe"
}
data = {
token = "dummy"#to be updated
}
}
# Terraform Cloud Operator for K8s helm chart
resource "helm_release" "operator" {
depends_on = [ kubernetes_namespace.tfe ]
name = "hcp-terraform-operator"
repository = "https://helm.releases.hashicorp.com"
chart = "hcp-terraform-operator"
version = "2.6.1"
namespace = "tfe"
}