A comprehensive Terraform module that provides a hardened GitOps bridge for Amazon EKS clusters, implementing security best practices and enterprise-grade configurations for GitOps workflows using ArgoCD.
- GitOps Integration: Seamless integration with ArgoCD for GitOps workflows
- Security Hardening: Enterprise-grade security configurations and best practices
- Multi-Repository Support: Support for addons, platform, and workloads repositories
- Flexible Deployment: Single cluster or hub-spoke architecture support
- Comprehensive Addons: Pre-configured essential Kubernetes addons
- RBAC Integration: Role-based access control with customizable permissions
- SSO Support: Microsoft Entra ID (Azure AD) integration
- Certificate Management: Automated SSL/TLS certificate provisioning
- Network Security: Security group management and ingress controls
- Secrets Management: Integration with AWS Secrets Manager and External Secrets
- Load Balancer Integration: AWS Load Balancer Controller support
- DNS Management: External DNS with Route53 integration
- Service Mesh: Optional Istio service mesh integration
- Ingress Management: Configurable ingress controllers and rules
- Metrics Collection: Metrics Server and custom metrics support
- Logging: Grafana Loki integration for centralized logging
- Workflow Management: Argo Workflows for CI/CD pipelines
Before using this module, ensure you have:
- Terraform: Version >= 1.0
- AWS CLI: Configured with appropriate permissions
- kubectl: For Kubernetes cluster access
- Existing EKS Cluster: The module requires an existing EKS cluster
- VPC and Subnets: Properly configured networking infrastructure
- Route53 Zones: For DNS management (optional)
The module requires the following AWS permissions:
- EKS cluster management
- IAM role and policy management
- VPC and security group management
- Route53 DNS management
- ACM certificate management
- Secrets Manager access
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GitOps Bridge Architecture β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Addons β β Platform β β Workloads β β
β β Repository β β Repository β β Repository β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β β β β
β βββββββββββββββββββββΌββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β ArgoCD β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β β Server β β Application β β Repository β β β
β β β β β Controller β β Server β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β EKS Cluster β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β β Addons β β Platform β β Application β β β
β β β β β Components β β Workloads β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
module "gitops_bridge" {
source = "path/to/terraform-hardening-gitops-bridge"
# Basic Configuration
enable = true
project_name = "my-project"
# EKS Cluster Configuration
cluster_name = "my-eks-cluster"
cluster_version = "1.30"
cluster_endpoint = "https://xxxxx.gr7.us-west-2.eks.amazonaws.com"
cluster_platform_version = "eks.1"
cluster_certificate_authority_data = "LS0tLS1CRUdJTi..."
oidc_provider_arn = "arn:aws:iam::123456789012:oidc-provider/..."
# Network Configuration
vpc_id = "vpc-12345678"
private_subnet_ids = ["subnet-12345678", "subnet-87654321"]
public_subnet_ids = ["subnet-abcdefgh", "subnet-hgfedcba"]
# GitOps Configuration
gitops_addons_org = "[email protected]:my-org"
gitops_addons_repo = "my-addons-repo"
# Basic Addons
addons = {
enable_aws_load_balancer_controller = true
enable_metrics_server = true
enable_external_secrets = true
}
tags = {
Environment = "production"
Project = "my-project"
}
}
For more complex scenarios, see the complete example which includes:
- SSO integration
- Custom certificates
- Istio service mesh
- Advanced networking
- User management
Example | Description | Use Case |
---|---|---|
Simple | Basic GitOps bridge setup | Development environments |
Complete | Full-featured configuration | Production environments |
The module supports three types of repositories:
- Addons Repository: Contains Kubernetes addons and operators
- Platform Repository: Contains platform-level configurations
- Workloads Repository: Contains application workloads
Addon | Description | Default |
---|---|---|
AWS Load Balancer Controller | Manages AWS ALB/NLB | β |
Metrics Server | Kubernetes metrics collection | β |
External Secrets | Secrets management | β |
External DNS | DNS management | β |
Secrets Store CSI Driver | CSI secrets integration | β |
Karpenter | Node autoscaling | β |
Cluster Autoscaler | Traditional autoscaling | β |
Istio | Service mesh | β |
Argo Workflows | Workflow engine | β |
Grafana Loki | Log aggregation | β |
enable_sso = true
tenant_id = "your-tenant-id"
client_id = "your-client-id"
client_secret = "your-client-secret"
user_management_config = {
enabled = true
store_in_secrets_manager = true
password_length = 16
default_role = "role:readonly"
}
This module implements several security best practices:
- Least Privilege Access: RBAC configurations follow least privilege principles
- Network Segmentation: Security groups and network policies
- Secrets Management: Integration with AWS Secrets Manager
- Certificate Management: Automated SSL/TLS certificate provisioning
- Audit Logging: Comprehensive logging and monitoring
Ideal for development and small-scale production environments:
gitops_deployment_type = "single"
Recommended for enterprise environments with multiple clusters:
gitops_deployment_type = "hub-spoke"
The module includes comprehensive monitoring capabilities:
- Metrics Server: Core Kubernetes metrics
- Grafana Loki: Centralized logging
- Argo Workflows: CI/CD pipeline monitoring
- External DNS: DNS resolution monitoring
addons = {
enable_metrics_server = true
enable_grafana_loki = true
}
# Port forward to ArgoCD UI
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Access ArgoCD at https://localhost:8080
addons = {
enable_karpenter = true
}
karpenter_discovery_tag = "project"
addons = {
enable_cluster_autoscaler = true
}
vpc_cni_conf_mode = "default_cfg"
vpc_cni_conf_mode = "custom_cfg"
core_cluster_apps_ingress_cidr = ["10.0.0.0/8", "172.16.0.0/12"]
conf_metadata = {
enable_custom_certificates = true
}
internal_apps_domain_names = [
"app1.internal.example.com",
"app2.internal.example.com"
]
addons = {
enable_external_secrets = true
enable_secrets_store_csi_driver = true
enable_secrets_store_csi_driver_provider_aws = true
}
user_management_config = {
enabled = true
store_in_secrets_manager = true
password_length = 16
bcrypt_cost = 10
}
external_dns_domain_filters = ["example.com", "internal.example.com"]
private_route53_zone_arn = ["arn:aws:route53:::hostedzone/Z123456789"]
public_route53_zone_arn = ["arn:aws:route53:::hostedzone/Z987654321"]
enable_argo_ingress = true
argo_host_dns = {
domain_name = "argocd.example.com"
zone_id = "Z123456789"
aws_load_balancer_type = "internet-facing"
validation = "dns"
}
gitops_repositories = [
"https://github.com/your-org/addons-repo",
"https://github.com/your-org/platform-repo",
"https://github.com/your-org/workloads-repo"
]
your-gitops-repo/
βββ addons/
β βββ aws-load-balancer-controller/
β βββ external-dns/
β βββ metrics-server/
βββ platform/
β βββ namespaces/
β βββ rbac/
β βββ policies/
βββ workloads/
βββ app1/
βββ app2/
βββ shared/
addons = {
enable_istio = true
}
conf_metadata = {
enable_istio_extensions = true
}
tags = {
Environment = "production"
Project = "my-project"
Owner = "platform-team"
CostCenter = "engineering"
Backup = "required"
Monitoring = "enabled"
}
- Use Karpenter for dynamic node scaling
- Enable spot instances where appropriate
- Monitor resource utilization with metrics server
- Implement resource quotas per namespace
main/master (production)
βββ develop (staging)
βββ feature/new-addon
βββ hotfix/security-patch
feat: add external-secrets addon
fix: resolve DNS resolution issue
docs: update README with new examples
chore: update addon versions
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-all-ingress
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restricted
apiVersion: v1
kind: ResourceQuota
metadata:
name: compute-quota
namespace: production
spec:
hard:
requests.cpu: "4"
requests.memory: 8Gi
limits.cpu: "8"
limits.memory: 16Gi
apiVersion: v1
kind: LimitRange
metadata:
name: default-limits
namespace: production
spec:
limits:
- default:
cpu: 500m
memory: 512Mi
defaultRequest:
cpu: 100m
memory: 128Mi
type: Container
- ArgoCD application sync status
- Kubernetes cluster health
- Resource utilization
- Security events
- DNS resolution times
groups:
- name: argocd
rules:
- alert: ArgoCDAppNotSynced
expr: argocd_app_info{sync_status!="Synced"} == 1
for: 5m
labels:
severity: warning
annotations:
summary: "ArgoCD application {{ $labels.name }} is not synced"
-
Git Repository Backups
- Multiple remote repositories
- Regular automated backups
- Version control history preservation
-
Cluster State Backups
# Backup ArgoCD configuration
kubectl get applications -n argocd -o yaml > argocd-apps-backup.yaml
# Backup secrets (encrypted)
kubectl get secrets --all-namespaces -o yaml > secrets-backup.yaml
- Recovery Procedures
# Restore ArgoCD applications
kubectl apply -f argocd-apps-backup.yaml
# Verify restoration
kubectl get applications -n argocd
- Notify stakeholders
- Backup current state
- Prepare rollback plan
- Test in staging environment
# Scale down non-essential workloads
kubectl scale deployment non-essential-app --replicas=0
# Perform maintenance tasks
terraform apply
# Verify system health
kubectl get pods --all-namespaces
# Check ArgoCD sync status
kubectl get applications -n argocd
# Verify addon functionality
kubectl get pods -n kube-system
# Test application endpoints
curl -k https://argocd.example.com/healthz
# Enable Karpenter for automatic node scaling
addons = {
enable_karpenter = true
}
# Configure node pools
karpenter_discovery_tag = "environment"
# ArgoCD server resource limits
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 1
memory: 2Gi
- Troubleshooting Guide - Comprehensive troubleshooting and debugging guide
- Migration Guide - Step-by-step migration from other GitOps solutions
- Upgrade Guide - Version upgrade instructions and compatibility matrix
- Examples - Working configuration examples
- ArgoCD Official Documentation
- AWS Load Balancer Controller
- External DNS Documentation
- Karpenter Documentation
We welcome contributions! Please see our Contributing Guide for details.
# Clone the repository
git clone <repository-url>
# Install pre-commit hooks
pre-commit install
# Run tests
make test
# Generate documentation
terraform-docs .
This module is licensed under the MIT License.
For help with this module:
- Documentation: Check the examples and this README
- Troubleshooting: See the Troubleshooting Guide for common issues and solutions
- Migration: Follow the Migration Guide for migrating from other GitOps solutions
- Upgrades: Use the Upgrade Guide for version upgrades
- Issues: Report bugs via GitHub Issues
- Discussions: Join our community discussions
################################################################################
# Complete Example - Terraform Hardening GitOps Bridge
################################################################################
terraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.20"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.9"
}
}
}
provider "aws" {
region = var.aws_region
}
# Data sources to get existing EKS cluster information
data "aws_eks_cluster" "cluster" {
name = var.cluster_name
}
data "aws_eks_cluster_auth" "cluster" {
name = var.cluster_name
}
data "aws_vpc" "selected" {
id = var.vpc_id
}
data "aws_subnets" "private" {
filter {
name = "vpc-id"
values = [var.vpc_id]
}
tags = {
Type = "Private"
}
}
data "aws_subnets" "public" {
filter {
name = "vpc-id"
values = [var.vpc_id]
}
tags = {
Type = "Public"
}
}
# Configure Kubernetes provider
provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
# Configure Helm provider
provider "helm" {
kubernetes {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
}
################################################################################
# GitOps Bridge Module
################################################################################
module "gitops_bridge" {
source = "../../"
# Basic Configuration
enable = true
project_name = var.project_name
# EKS Cluster Configuration
cluster_name = var.cluster_name
cluster_version = data.aws_eks_cluster.cluster.version
cluster_endpoint = data.aws_eks_cluster.cluster.endpoint
cluster_platform_version = data.aws_eks_cluster.cluster.platform_version
cluster_certificate_authority_data = data.aws_eks_cluster.cluster.certificate_authority[0].data
oidc_provider_arn = data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer
# Network Configuration
vpc_id = var.vpc_id
private_subnet_ids = data.aws_subnets.private.ids
public_subnet_ids = data.aws_subnets.public.ids
# GitOps Configuration
gitops_deployment_type = "single"
# Addons Repository Configuration
gitops_addons_org = var.gitops_addons_org
gitops_addons_repo = var.gitops_addons_repo
gitops_addons_revision = var.gitops_addons_revision
gitops_addons_basepath = var.gitops_addons_basepath
gitops_addons_path = var.gitops_addons_path
# Platform Repository Configuration
gitops_platform_org = var.gitops_platform_org
gitops_platform_repo = var.gitops_platform_repo
gitops_platform_revision = var.gitops_platform_revision
gitops_platform_basepath = var.gitops_platform_basepath
gitops_platform_path = var.gitops_platform_path
# Workloads Repository Configuration
gitops_workloads_org = var.gitops_workloads_org
gitops_workloads_repo = var.gitops_workloads_repo
gitops_workloads_revision = var.gitops_workloads_revision
gitops_workloads_basepath = var.gitops_workloads_basepath
gitops_workloads_path = var.gitops_workloads_path
# GitOps Authentication
gitops_user = var.gitops_user
GITOPS_PASSWORD = var.gitops_password
# Kubernetes Addons Configuration
addons = {
enable_aws_load_balancer_controller = true
enable_metrics_server = true
enable_external_secrets = true
enable_external_dns = true
enable_secrets_store_csi_driver = true
enable_secrets_store_csi_driver_provider_aws = true
enable_karpenter = var.enable_karpenter
enable_cluster_autoscaler = var.enable_cluster_autoscaler
enable_aws_node_termination_handler = var.enable_aws_node_termination_handler
enable_argo_workflows = true
enable_istio = var.enable_istio
enable_grafana_loki = true
}
# Configuration Metadata
conf_metadata = {
enable_karpenter_conf = var.enable_karpenter
enable_system_customizations = true
enable_kafka_ops = false
enable_tm_namespaces = false
enable_cni_custom = var.vpc_cni_conf_mode == "custom_cfg"
enable_istio_extensions = var.enable_istio
enable_custom_certificates = var.enable_custom_certificates
}
# DNS Configuration
external_dns_domain_filters = var.external_dns_domain_filters
private_route53_zone_arn = var.private_route53_zone_arn
public_route53_zone_arn = var.public_route53_zone_arn
# VPC CNI Configuration
vpc_cni_conf_mode = var.vpc_cni_conf_mode
# Karpenter Configuration
karpenter_discovery_tag = var.karpenter_discovery_tag
# ArgoCD Configuration
default_argoproj_name = var.default_argoproj_name
gitops_repositories = var.gitops_repositories
# ArgoCD Ingress Configuration
enable_argo_ingress = var.enable_argo_ingress
argo_host_dns = var.enable_argo_ingress ? {
domain_name = var.argo_domain_name
zone_id = var.argo_zone_id
aws_load_balancer_type = var.argo_load_balancer_type
validation = var.argo_validation_type
} : null
# SSO Configuration
enable_sso = var.enable_sso
tenant_id = var.tenant_id
client_id = var.client_id
client_secret = var.client_secret
# User Management Configuration
user_management_config = {
enabled = var.enable_user_management
store_in_secrets_manager = true
password_length = 16
password_special_chars = "!#$%&*()-_=+[]{}<>:?"
bcrypt_cost = 10
default_role = "role:readonly"
}
# Custom Certificates
internal_apps_domain_names = var.internal_apps_domain_names
# Security Configuration
core_cluster_apps_ingress_cidr = var.core_cluster_apps_ingress_cidr
# Tags
tags = merge(var.tags, {
Environment = var.environment
Project = var.project_name
ManagedBy = "Terraform"
Example = "complete"
})
}
No requirements.
Name | Version |
---|---|
aws | n/a |
kubernetes | n/a |
Name | Source | Version |
---|---|---|
acm | terraform-aws-modules/acm/aws | ~> 4.0 |
argocd_irsa | aws-ia/eks-blueprints-addon/aws | 1.1.1 |
aws_vpc_cni_ipv4_pod_identity | terraform-aws-modules/eks-pod-identity/aws | 1.12.1 |
core_ingress_sg | terraform-aws-modules/security-group/aws | 5.3.0 |
eks_blueprints_addons | aws-ia/eks-blueprints-addons/aws | 1.21.1 |
eks_native_addons | ./modules/terraform-eks-addons | n/a |
eks_vpc_cni_native_addons | ./modules/terraform-eks-addons | n/a |
hardening_gitops_bridge | ./modules/terraform-helm-gitops-bridge-module | n/a |
node_alb_traffic_rules | terraform-aws-modules/security-group/aws | 5.3.0 |
Name | Type |
---|---|
aws_availability_zones.available | data source |
aws_caller_identity.current | data source |
aws_iam_policy_document.irsa_policy | data source |
aws_iam_session_context.current | data source |
aws_region.current | data source |
This module accepts the following input variables. Variables are organized by category for easier navigation.
These inputs are required for the module to function properly:
| Name | Description | Type | Default | Required |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cluster_certificate_authority_data | Base64 encoded certificate data required to communicate with the cluster | string |
n/a | yes |
cluster_endpoint | Endpoint for your Kubernetes API server | string |
n/a | yes |
cluster_name | Name of the EKS cluster | string |
n/a | yes |
cluster_platform_version | Platform version for the cluster | string |
n/a | yes |
oidc_provider_arn | The ARN of the OIDC Provider | string |
n/a | yes |
These inputs have default values and can be customized based on your requirements:
| GITOPS_PASSWORD | GitOps password or token | string
| null
| no |
| addons | Kubernetes addons | any
|
{| no | | argo_host_dns | Argo host for public access using ALB |
"enable_argo_workflows": true,
"enable_aws_load_balancer_controller": true,
"enable_aws_node_termination_handler": false,
"enable_cluster_autoscaler": false,
"enable_external_dns": true,
"enable_external_secrets": true,
"enable_grafana_loki": true,
"enable_istio": false,
"enable_karpenter": false,
"enable_metrics_server": true,
"enable_secrets_store_csi_driver": true,
"enable_secrets_store_csi_driver_provider_aws": true
}
object({|
domain_name = string
zone_id = optional(string)
aws_load_balancer_type = optional(string)
validation = optional(string)
})
{| no | | argocd_iam_role_arn | The ARN of the IAM role for Argo CD |
"aws_load_balancer_type": "internal",
"domain_name": "example.com",
"validation": "private",
"zone_id": "XXXXXXXXXXXXXX"
}
string
| ""
| no |
| client_id | Client ID for Microsoft Entra ID SSO | string
| null
| no |
| client_secret | Client Secret for Microsoft Entra ID SSO | string
| null
| no |
| cluster_autoscaler | Cluster Autoscaler add-on configuration values | any
| {}
| no |
| cluster_version | Kubernetes version for the cluster | string
| "1.30"
| no |
| conf_metadata | Metadata for the configuration | object({|
enable_karpenter_conf = bool
enable_system_customizations = bool
enable_kafka_ops = bool
enable_tm_namespaces = bool
enable_cni_custom = bool
enable_istio_extensions = bool
enable_custom_certificates = bool
})
{| no | | core_cluster_apps_ingress_cidr | Ingress CIDR for core cluster apps |
"enable_cni_custom": false,
"enable_custom_certificates": false,
"enable_istio_extensions": false,
"enable_kafka_ops": false,
"enable_karpenter_conf": false,
"enable_system_customizations": false,
"enable_tm_namespaces": false
}
list(string)
| []
| no |
| default_argoproj_name | Default argocd name | string
| "ldc-fc-contenerizacion-ti"
| no |
| eks_auto_scaling_groups_arns | List of EKS Auto Scaling Groups ARNs | list(string)
| []
| no |
| enable | Enable or disable stack creation | bool
| true
| no |
| enable_argo_ingress | Enable Argo CD ALB ingress | bool
| false
| no |
| enable_cluster_autoscaler | Enable Cluster autoscaler add-on | bool
| false
| no |
| enable_sso | Enable SSO integration with Entra ID | bool
| false
| no |
| external_dns_domain_filters | External domains filters | list(string)
| []
| no |
| gitops_addons_basepath | Git repository base path for addons | string
| "gitops/addons/"
| no |
| gitops_addons_org | Git repository org/user contains for addons | string
| "[email protected]:gitops-bridge-dev"
| no |
| gitops_addons_path | Git repository path for addons | string
| "bootstrap/control-plane/addons"
| no |
| gitops_addons_repo | Git repository contains for addons | string
| "gitops-bridge-argocd-control-plane-template"
| no |
| gitops_addons_revision | Git repository revision/branch/ref for addons | string
| "HEAD"
| no |
| gitops_deployment_type | GitOps type architecture deployment. hub-spoke, single | string
| "single"
| no |
| gitops_platform_basepath | Git repository base path for platform | string
| ""
| no |
| gitops_platform_org | Git repository org/user contains for addons | string
| "[email protected]:gitops-bridge-dev"
| no |
| gitops_platform_path | Git repository path for workload | string
| "bootstrap"
| no |
| gitops_platform_repo | Git repository name for platform | string
| "gitops-platform"
| no |
| gitops_platform_revision | Git repository revision/branch/ref for workload | string
| "HEAD"
| no |
| gitops_repositories | List of allowed repositories in the Argo CD AppProject | list(string)
| [| no | | gitops_user | GitOps user |
"https://aws.github.io/",
"https://kubernetes-sigs.github.io/",
"public.ecr.aws",
"https://kiali.org/helm-charts",
"https://charts.external-secrets.io",
"https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts",
"https://istio-release.storage.googleapis.com/charts",
"https://argoproj.github.io/argo-helm",
"https://grafana.github.io/helm-charts",
"public.ecr.aws/dynatrace"
]
string
| "gitops"
| no |
| gitops_workloads_basepath | Git repository base path for workload | string
| ""
| no |
| gitops_workloads_org | Git repository org/user contains for addons | string
| "[email protected]:gitops-bridge-dev"
| no |
| gitops_workloads_path | Git repository path for workload | string
| ""
| no |
| gitops_workloads_repo | Git repository name for workload | string
| "gitops-apps"
| no |
| gitops_workloads_revision | Git repository revision/branch/ref for workload | string
| "HEAD"
| no |
| internal_apps_domain_names | Domain names for internal applications | list(string)
| []
| no |
| karpenter_discovery_tag | Karpenter tag for discovery resources | string
| "project"
| no |
| node_security_group | Node security group ID | string
| ""
| no |
| private_route53_zone_arn | Private Route53 zone ARN | list(string)
| []
| no |
| private_subnet_ids | List of private subnet IDs | list(string)
| []
| no |
| project_name | Project Name | string
| ""
| no |
| public_route53_zone_arn | Public Route53 zone ARN | list(string)
| []
| no |
| public_subnet_ids | List of public subnet IDs | list(string)
| []
| no |
| subnet_details | Map of subnet details | map(list(object({|
cidr = string
subnetId = string
availabilityZone = string
})))
{}
| no |
| tags | A map of tags to add to all resources | map(string)
| {}
| no |
| tenant_id | Tenant ID for Microsoft Entra ID SSO | string
| null
| no |
| user_management_config | Configuration for user management features | object({|
enabled = bool
store_in_secrets_manager = bool
password_length = number
password_special_chars = string
bcrypt_cost = number
default_role = string
})
{| no | | vpc_cni_conf_mode | VPC CNI mode, use custom_cfg for secondary subnets and default_cfg for delegation prefix |
"bcrypt_cost": 10,
"default_role": "role:readonly",
"enabled": false,
"password_length": 16,
"password_special_chars": "!#$%&*()-_=+[]{}<>:?",
"store_in_secrets_manager": true
}
string
| "default_cfg"
| no |
| vpc_id | VPC Id | string
| ""
| no |
module "gitops_bridge" {
source = "path/to/terraform-hardening-gitops-bridge"
# Required inputs - must be provided
cluster_name = "my-eks-cluster"
cluster_endpoint = "https://xxxxx.gr7.us-west-2.eks.amazonaws.com"
cluster_certificate_authority_data = "LS0tLS1CRUdJTi..."
cluster_platform_version = "eks.1"
oidc_provider_arn = "arn:aws:iam::123456789012:oidc-provider/..."
}
# Basic GitOps setup
gitops_addons_org = "[email protected]:my-org"
gitops_addons_repo = "my-addons-repo"
# Enable essential addons
addons = {
enable_aws_load_balancer_controller = true
enable_metrics_server = true
enable_external_secrets = true
enable_external_dns = true
}
# SSO configuration
enable_sso = true
tenant_id = "your-tenant-id"
client_id = "your-client-id"
client_secret = "your-client-secret"
- cluster_name: Must be a valid EKS cluster name (1-100 characters, alphanumeric and hyphens)
- cluster_endpoint: Must be a valid HTTPS URL
- oidc_provider_arn: Must be a valid AWS IAM OIDC provider ARN
- vpc_id: Must be a valid VPC ID if provided
- subnet_ids: Must be valid subnet IDs within the specified VPC
The module provides the following outputs that can be used by other Terraform configurations or for reference:
Name | Description | Type | Sensitive |
---|---|---|---|
addons | Map of enabled EKS addons and their configurations | map(any) |
No |
# Access the addons output
output "enabled_addons" {
description = "List of enabled addons"
value = module.gitops_bridge.addons
}
# Use outputs in other resources
resource "aws_ssm_parameter" "addon_status" {
name = "/eks/${var.cluster_name}/addons"
type = "String"
value = jsonencode(module.gitops_bridge.addons)
}
While not exposed as outputs, the module creates several resources that can be referenced:
- ArgoCD Applications: Available in the
argocd
namespace - Security Groups: Created for ingress and load balancer traffic
- IAM Roles: Service account roles for various addons
- Route53 Records: DNS records for ingress endpoints (if configured)
# Access ArgoCD applications
kubectl get applications -n argocd
# View created security groups
aws ec2 describe-security-groups --filters "Name=tag:kubernetes.io/cluster/${cluster_name},Values=owned"
# Check addon status
kubectl get pods -n kube-system
A: Yes, this module is designed to work with existing EKS clusters. You just need to provide the cluster details.
A: Set enable_sso = true
and provide your tenant_id
, client_id
, and client_secret
.
A: Yes, you can customize ArgoCD through the module's configuration options and Helm values.
A: You can extend the addons configuration or add custom applications through your GitOps repositories.
A: Yes, this module implements enterprise-grade security and best practices suitable for production environments.
A: ArgoCD configurations are stored in your Git repositories, providing built-in backup and version control.
A: Yes, you can deploy this module across multiple AWS accounts with proper cross-account IAM roles.
A: Use ArgoCD's built-in UI and integrate with your monitoring stack using the provided observability addons.