Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 29 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@ jobs:
chmod +x terraform-docs
mv terraform-docs /home/runner/work/terraform-docs

- name: Validate Terraform modules
run: |
set +e # Disable immediate exit on error
FAILED=0
TF_DIRS=$(git diff --name-only origin/main HEAD | xargs -n1 dirname | sort -u)
for DIR in $TF_DIRS; do
echo "Validating Terraform in directory: $DIR"
(cd $DIR; terraform fmt -check)
if [ $? -ne 0 ]; then
echo "Format failed in $DIR"
FAILED=1
fi
(cd $DIR; terraform init -backend=false &>/dev/null; terraform validate)
if [ $? -ne 0 ]; then
echo "Validation failed in $DIR"
FAILED=1
fi
# TODO: Enable doc validation
# (cd $DIR; /home/runner/work/terraform-docs markdown table . >> README.md)
# git diff $DIR/README.md
# if [ -n "$(git diff $DIR/README.md)" ]; then
# echo "Documentation failed in $DIR"
# FAILED=1
# fi
done

if [ $FAILED -ne 0 ]; then
exit 1 # Exit with error if any validation failed
fi
# - name: Validate Terraform modules
# run: |
# set +e # Disable immediate exit on error
# FAILED=0
# TF_DIRS=$(git diff --name-only origin/main HEAD | xargs -n1 dirname | sort -u)
# for DIR in $TF_DIRS; do
# echo "Validating Terraform in directory: $DIR"
# (cd $DIR; terraform fmt -check)
# if [ $? -ne 0 ]; then
# echo "Format failed in $DIR"
# FAILED=1
# fi
# (cd $DIR; terraform init -backend=false &>/dev/null; terraform validate)
# if [ $? -ne 0 ]; then
# echo "Validation failed in $DIR"
# FAILED=1
# fi
# # TODO: Enable doc validation
# # (cd $DIR; /home/runner/work/terraform-docs markdown table . >> README.md)
# # git diff $DIR/README.md
# # if [ -n "$(git diff $DIR/README.md)" ]; then
# # echo "Documentation failed in $DIR"
# # FAILED=1
# # fi
# done
#
# if [ $FAILED -ne 0 ]; then
# exit 1 # Exit with error if any validation failed
# fi
File renamed without changes.
Empty file added customer-user/output.tf
Empty file.
Empty file added customer-user/variables.tf
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# VPC Config
################################################################################
module "foundations_vpc" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/vpc?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/vpc?ref=v2"
account = var.account
organization = var.organization
vpc = var.vpc
Expand All @@ -12,7 +12,7 @@ module "foundations_vpc" {
# Route53 Config
################################################################################
module "foundations_route53" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/route53?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/route53?ref=v2"

domain_name = var.domain_name
vpc_id = module.foundations_vpc.vpc_id
Expand All @@ -22,7 +22,7 @@ module "foundations_route53" {
# EKS Config
################################################################################
module "foundations_eks" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/eks?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/eks?ref=v2"

name = var.eks_cluster_name
aws_subnets_private_ids = module.foundations_vpc.private_subnets
Expand All @@ -33,7 +33,7 @@ module "foundations_eks" {
# ALB-Controller Config
################################################################################
module "foundations_alb_controller" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/alb-controller?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/foundations/aws/alb-controller?ref=v2"

cluster_name = module.foundations_eks.eks_cluster_name
vpc_id = module.foundations_vpc.vpc_id
Expand All @@ -47,7 +47,7 @@ module "foundations_alb_controller" {
# Platform Config
################################################################################
module "nullplatform_configuration" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_providers?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_providers?ref=v2"

domain_name = var.domain_name
environment = var.environment
Expand All @@ -65,17 +65,17 @@ module "nullplatform_configuration" {
# Users Config
################################################################################
module "nullplatform_user" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_users?ref=chore/IaC-v2"
np_api_key = var.api_key
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_users?ref=v2"
np_api_key = var.api_key
nullplatform_users = var.nullplatform_users
}

################################################################################
# Acount Config
################################################################################
module "nullplatform_account" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_account?ref=chore/IaC-v2"
np_api_key = var.api_key
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_account?ref=v2"
np_api_key = var.api_key
nullplatform_accounts = var.nullplatform_accounts
}

Expand All @@ -85,7 +85,7 @@ module "nullplatform_account" {
################################################################################

module "nullplatform_agent" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_agent?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_agent?ref=v2"
cluster_name = module.foundations_eks.eks_cluster_name
tags = var.tags
nrn = var.nrn
Expand All @@ -100,7 +100,7 @@ module "nullplatform_agent" {
################################################################################

module "nullplatform_base_chart" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_base?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_base?ref=v2"
nrn = var.nrn

depends_on = [module.foundations_eks]
Expand All @@ -111,7 +111,7 @@ module "nullplatform_base_chart" {
################################################################################

module "nullplatform_prometheus" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/workload/prometheus?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/workload/prometheus?ref=v2"
cluster_name = module.foundations_eks.eks_cluster_name
nrn = var.nrn
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ variable "environment_tags" {

variable "nullplatform_users" {
type = map(object({
email = string
first_name = string
last_name = string
email = string
first_name = string
last_name = string
}))
}

variable "nullplatform_accounts" {
type = map(object({
name = string
repository_prefix = string
name = string
repository_prefix = string
repository_provider = string
slug = string
slug = string
}))
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Platform Config
################################################################################
module "nullplatform_configuration" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_providers?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_providers?ref=v2"

domain_name = var.domain_name
environment = var.environment
Expand All @@ -19,17 +19,17 @@ module "nullplatform_configuration" {
# Users Config
################################################################################
module "nullplatform_user" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_users?ref=chore/IaC-v2"
np_api_key = var.api_key
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_users?ref=v2"
np_api_key = var.api_key
nullplatform_users = var.nullplatform_users
}

################################################################################
# Acount Config
################################################################################
module "nullplatform_account" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_account?ref=chore/IaC-v2"
np_api_key = var.api_key
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_account?ref=v2"
np_api_key = var.api_key
nullplatform_accounts = var.nullplatform_accounts
}

Expand All @@ -39,7 +39,7 @@ module "nullplatform_account" {
################################################################################

module "nullplatform_agent" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_agent?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/aws/nullplatform_agent?ref=v2"
cluster_name = var.eks_cluster_name
tags = var.tags
nrn = var.nrn
Expand All @@ -54,7 +54,7 @@ module "nullplatform_agent" {
################################################################################

module "nullplatform_base_chart" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_base?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/nullplatform/nullplatform_base?ref=v2"
nrn = var.nrn
}

Expand All @@ -63,7 +63,7 @@ module "nullplatform_base_chart" {
################################################################################

module "nullplatform_prometheus" {
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/workload/prometheus?ref=chore/IaC-v2"
source = "git::https://github.com/nullplatform/main-terraform-modules.git//v2/workload/prometheus?ref=v2"
cluster_name = var.eks_cluster_name
nrn = var.nrn
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ variable "environment_tags" {

variable "nullplatform_users" {
type = map(object({
email = string
first_name = string
last_name = string
email = string
first_name = string
last_name = string
}))
}

variable "nullplatform_accounts" {
type = map(object({
name = string
repository_prefix = string
name = string
repository_prefix = string
repository_provider = string
slug = string
slug = string
}))
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ variable "domain_name" {
variable "subject_alternative_names" {
type = list(string)
description = "Alternative DNS to add"
default = []
default = []
}
37 changes: 0 additions & 37 deletions infrastructure/aws/alb-controller/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions infrastructure/aws/alb-controller/data.tf

This file was deleted.

5 changes: 3 additions & 2 deletions infrastructure/aws/alb-controller/iam.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module "aws-load-balancer-controller-role" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts"
version = "~> 6.0"
name = "AWSLoadBalancerControllerIAMRole"
attach_load_balancer_controller_policy = true
use_name_prefix = false
use_name_prefix = false
oidc_providers = {
main = {
provider_arn = data.aws_iam_openid_connect_provider.this.arn
provider_arn = var.aws_iam_openid_connect_provider
namespace_service_accounts = ["kube-system:aws-load-balancer-controller"]
}
}
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/aws/alb-controller/locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
aws-load-balancer-controller-values = templatefile("${path.module}/templates/aws-load-balancer-controller-values.tmpl.yaml", {
cluster_name = var.cluster_name
cluster_name = var.cluster_name
service_account_name = kubernetes_service_account.aws-load-balancer-controller-sa.metadata[0].name
vpc_id = var.vpc_id
})
vpc_id = var.vpc_id
})
}
26 changes: 13 additions & 13 deletions infrastructure/aws/alb-controller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ resource "helm_release" "aws-load-balancer-controller" {
version = var.aws-load-balancer-controller-version
namespace = "kube-system"

disable_webhooks = true
force_update = true
wait = true
wait_for_jobs = true
timeout = 600
atomic = true
cleanup_on_fail = true
replace = false
recreate_pods = false
reset_values = false
reuse_values = false
dependency_update = true
max_history = 10
disable_webhooks = true
force_update = true
wait = true
wait_for_jobs = true
timeout = 600
atomic = true
cleanup_on_fail = true
replace = false
recreate_pods = false
reset_values = false
reuse_values = false
dependency_update = true
max_history = 10


values = [local.aws-load-balancer-controller-values]
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/aws/alb-controller/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ variable "aws-load-balancer-controller-version" {
description = "Version of the AWS Load Balancer Controller Helm chart"
type = string
default = "1.13.4"
}

variable "aws_iam_openid_connect_provider" {

}
Loading