Skip to content

Commit

Permalink
formatted all terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
bensoer committed Apr 17, 2024
1 parent 64f90ae commit c54ac88
Show file tree
Hide file tree
Showing 22 changed files with 360 additions and 360 deletions.
96 changes: 48 additions & 48 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.27.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
}

kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
}

cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 2.0"
}
required_providers {
digitalocean = {

Check warning on line 3 in main.tf

View workflow job for this annotation

GitHub Actions / Run TFLint Scans

Missing version constraint for provider "digitalocean" in `required_providers`
source = "digitalocean/digitalocean"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.27.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
}

kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
}

cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 2.0"
}
}
}


module "k8infra" {
source = "./modules/k8infra"
do_token = var.do_token
source = "./modules/k8infra"
do_token = var.do_token

providers = {
digitalocean = digitalocean
cloudflare = cloudflare
}
providers = {
digitalocean = digitalocean
cloudflare = cloudflare
}
}

resource time_sleep "wait_60_seconds" {
depends_on = [ module.k8infra ]
resource "time_sleep" "wait_60_seconds" {

Check warning on line 38 in main.tf

View workflow job for this annotation

GitHub Actions / Run TFLint Scans

Missing version constraint for provider "time" in `required_providers`
depends_on = [module.k8infra]
create_duration = "60s"
}

module "k8config" {
source = "./modules/k8config"

cluster_id = module.k8infra.cluster_id
cluster_name = module.k8infra.cluster_name
do_token = var.do_token
cf_email = var.cf_email
cf_token = var.cf_token
domain = var.domain

providers = {
kubernetes = kubernetes
helm=helm
kubectl = kubectl
}

depends_on = [
time_sleep.wait_60_seconds
]
source = "./modules/k8config"

cluster_id = module.k8infra.cluster_id
cluster_name = module.k8infra.cluster_name
do_token = var.do_token
cf_email = var.cf_email
cf_token = var.cf_token
domain = var.domain

providers = {
kubernetes = kubernetes
helm = helm
kubectl = kubectl
}

depends_on = [
time_sleep.wait_60_seconds
]

}
64 changes: 32 additions & 32 deletions modules/k8config/main.tf
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.27.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
}
kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
}
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.27.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
}
kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
}
}
}

module "crds"{
module "crds" {
source = "./modules/crds"

providers = {
kubectl = kubectl
}
}

resource time_sleep "wait_60_seconds" {
depends_on = [ module.crds ]
resource "time_sleep" "wait_60_seconds" {
depends_on = [module.crds]
create_duration = "60s"
}

Expand All @@ -35,14 +35,14 @@ module "certmanager" {
cf_token = var.cf_token

providers = {
helm = helm
helm = helm
kubernetes = kubernetes
kubectl = kubectl
kubectl = kubectl
}

depends_on = [
depends_on = [
time_sleep.wait_60_seconds
]
]
}


Expand All @@ -51,15 +51,15 @@ module "traefik" {

cf_email = var.cf_email
cf_token = var.cf_token
domain = var.domain
domain = var.domain

providers = {
helm = helm
helm = helm
kubernetes = kubernetes
kubectl = kubectl
kubectl = kubectl
}

depends_on = [
depends_on = [
module.certmanager
]
}
Expand All @@ -70,7 +70,7 @@ module "argocd" {
domain = var.domain

providers = {
helm = helm,
helm = helm,
kubectl = kubectl
}

Expand All @@ -86,27 +86,27 @@ module "prometheus" {
domain = var.domain

providers = {
helm = helm
helm = helm
kubernetes = kubernetes
kubectl = kubectl
kubectl = kubectl
}

depends_on = [
depends_on = [
module.certmanager,
module.traefik,
time_sleep.wait_60_seconds
]
]
}

module "kyverno" {
source = "./modules/kyverno"

providers = {
kubectl = kubectl
helm = helm
helm = helm
}

depends_on = [
depends_on = [
module.prometheus,
time_sleep.wait_60_seconds
]
Expand All @@ -117,7 +117,7 @@ module "elasticsearch" {

providers = {
kubectl = kubectl
helm = helm
helm = helm
}

depends_on = [
Expand Down
56 changes: 28 additions & 28 deletions modules/k8config/modules/_archive/grafana/main.tf
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.27.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
}
kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
}
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.27.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
}
kubectl = {
source = "alekc/kubectl"
version = "2.0.4"
}
}
}

resource "helm_release" "grafana" {
name = "grafana"

repository = "https://grafana.github.io/helm-charts"
chart = "grafana"
chart = "grafana"

atomic = true

# due to order of things, the namespace is created seperatly
create_namespace = false
namespace = "grafana"
namespace = "grafana"

recreate_pods = true
reuse_values = true
force_update = true
cleanup_on_fail = true
recreate_pods = true
reuse_values = true
force_update = true
cleanup_on_fail = true
dependency_update = true

values = [
file("${abspath(path.module)}/res/grafana-values.yaml")
]

depends_on = [
depends_on = [
kubernetes_secret.grafana_dashboard_credentials,
kubernetes_namespace.grafana_namespace
]
]
}

resource "random_password" "password" {
length = 25
special = false
length = 25
special = false
#override_special = "!#$%&*()-_=+[]{}<>:?"
}

Expand All @@ -57,7 +57,7 @@ resource "kubernetes_namespace" "grafana_namespace" {

resource "kubernetes_secret" "grafana_dashboard_credentials" {
metadata {
name = "grafana-dashboard-admin-credentials"
name = "grafana-dashboard-admin-credentials"
namespace = "grafana"
}

Expand All @@ -66,17 +66,17 @@ resource "kubernetes_secret" "grafana_dashboard_credentials" {
password = random_password.password.result
}

depends_on = [
depends_on = [
kubernetes_namespace.grafana_namespace
]
]
}

resource "kubectl_manifest" "grafana_ingress_certificate" {
yaml_body = templatefile("${abspath(path.module)}/res/grafana-ingress-certificate.yaml.tftpl", {
domain = var.domain
})

depends_on = [
depends_on = [
helm_release.grafana
]
}
Expand All @@ -86,7 +86,7 @@ resource "kubectl_manifest" "grafana_ingress" {
domain = var.domain
})

depends_on = [
depends_on = [
helm_release.grafana,
kubectl_manifest.grafana_ingress_certificate
]
Expand Down
6 changes: 3 additions & 3 deletions modules/k8config/modules/_archive/grafana/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "domain" {
description = "Root Domain For Service"
sensitive = true
type = string
description = "Root Domain For Service"
sensitive = true
type = string
}
Loading

0 comments on commit c54ac88

Please sign in to comment.