Skip to content

Commit b4ae88e

Browse files
add env
1 parent e036a0b commit b4ae88e

File tree

8 files changed

+168
-0
lines changed

8 files changed

+168
-0
lines changed

contrib/terraform/envs/svc.dd.soeren.cloud/.terraform.lock.hcl

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parent_zone_id = "Z0237504SXBCD16NK65T"
2+
wildcard_records_v4 = [
3+
"192.168.65.27"
4+
]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include "root" {
2+
path = find_in_parent_folders()
3+
}
4+
5+
inputs = {
6+
cluster_name = basename(get_terragrunt_dir())
7+
route53_subdomain = basename(get_terragrunt_dir())
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa
2+
terraform {
3+
backend "s3" {
4+
bucket = "soerenschneider-terraform"
5+
key = "k8s-gitops-svc.dd.soeren.cloud/terraform.tfstate"
6+
region = "us-east-1"
7+
encrypt = true
8+
}
9+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module "route53_subdomain" {
2+
source = "../../modules/route53-subdomain"
3+
4+
parent_zone_id = var.parent_zone_id
5+
subdomain = var.route53_subdomain
6+
7+
wildcard_records_v4 = var.wildcard_records_v4
8+
wildcard_records_v6 = var.wildcard_records_v6
9+
}
10+
11+
module "cert_manager" {
12+
source = "../../modules/iam-cert-manager"
13+
count = var.use_cert_manager ? 1 : 0
14+
cluster_name = var.cluster_name
15+
hosted_zone_id = module.route53_subdomain.subdomain_zone_id
16+
}
17+
18+
module "external_dns" {
19+
source = "../../modules/iam-external-dns"
20+
count = var.use_external_dns ? 1 : 0
21+
cluster_name = var.cluster_name
22+
hosted_zone_id = module.route53_subdomain.subdomain_zone_id
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "subdomain_zone_id" {
2+
value = module.route53_subdomain.subdomain_zone_id
3+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
version = "5.76.0"
6+
}
7+
8+
kubernetes = {
9+
source = "hashicorp/kubernetes"
10+
version = "2.34.0"
11+
}
12+
13+
local = {
14+
source = "hashicorp/local"
15+
}
16+
}
17+
}
18+
19+
provider "aws" {
20+
region = "us-east-1"
21+
default_tags {
22+
tags = {
23+
project = "k8s-gitops"
24+
project_url = "https://github.com/k8s-gitops/contrib/terraform"
25+
managed_by = "terraform"
26+
env = "svc.dd.soeren.cloud"
27+
}
28+
}
29+
}
30+
31+
provider "kubernetes" {
32+
config_path = "~/.kube/config"
33+
config_context = "dd"
34+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
variable "parent_zone_id" {
2+
description = "The Route 53 Hosted Zone ID for the parent domain"
3+
type = string
4+
}
5+
6+
variable "use_cert_manager" {
7+
type = bool
8+
default = true
9+
}
10+
11+
variable "use_external_dns" {
12+
type = bool
13+
default = false
14+
}
15+
16+
variable "route53_subdomain" {
17+
type = string
18+
}
19+
20+
variable "cluster_name" {
21+
type = string
22+
}
23+
24+
variable "wildcard_records_v4" {
25+
type = list(string)
26+
default = []
27+
}
28+
29+
variable "wildcard_records_v6" {
30+
type = list(string)
31+
default = []
32+
}

0 commit comments

Comments
 (0)