Enterprise-grade Elasticsearch monitoring stack deployed with Infrastructure as Code (IaC) and automated CI/CD pipelines across multiple cloud providers. Enterprise-grade Elasticsearch monitoring stack deployed with Infrastructure as Code (IaC) and automated CI/CD pipelines across multiple cloud providers (AWS EKS + Azure AKS).
This project provides a complete, production-ready Elasticsearch monitoring stack deployed across multiple cloud providers (AWS EKS and Azure AKS) using Terraform. It includes automated CI/CD pipelines, multi-environment support, enterprise-grade security features, and true multi-cloud capabilities.
- ποΈ Infrastructure as Code - Complete multi-cloud infrastructure defined in Terraform
- π Multi-Cloud Support - Deploy on AWS EKS, Azure AKS, or both simultaneously
- π Automated CI/CD - GitHub Actions pipeline with multi-environment deployment
- π Enterprise Security - X-Pack security, SSL/TLS, and RBAC
- π Monitoring Stack - Elasticsearch, Kibana, and comprehensive monitoring
- π Multi-Environment - Development, Staging, and Production configurations
- π° Cost Optimization - Auto-scaling, spot instances, and resource management
- π GitOps Ready - ArgoCD integration for advanced deployment strategies
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GitHub Repository β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββ β
β β Development β β Staging β β Production β β
β β Branch β β Branch β β Branch β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GitHub Actions CI/CD β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β Security β β Validate β β Deploy & Test β β
β β Scan β β Terraform β β Environments β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Multi-Cloud Infrastructure β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β AWS β β Azure β β Elasticsearch β β
β β EKS β β AKS β β + Kibana Stack β β
β β (Primary) β β (Secondary) β β (Multi-Cloud) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Terraform >= 1.5.0
- AWS CLI configured
- Azure CLI configured
- kubectl >= 1.28
- GitHub Account with repository access
git clone https://github.com/InfraPlatformer/elastic-terraform-demo.git
cd elastic-terraform-demoaws configure
# Enter your AWS Access Key ID, Secret Access Key, and Regionaz login
az account set --subscription "your-subscription-id"# Navigate to development environment
cd environments/development
# Initialize Terraform
terraform init
# Plan deployment (multi-cloud)
terraform plan
# Apply infrastructure
terraform apply -auto-approve# Configure kubectl for AWS EKS
aws eks update-kubeconfig --region us-west-2 --name advanced-elastic-development-aws
# Configure kubectl for Azure AKS
az aks get-credentials --resource-group multi-cloud-elastic-rg --name advanced-elastic-development-aws-azure
# Check Elasticsearch on AWS
kubectl get pods -n elasticsearch --context=aws
# Check Elasticsearch on Azure
kubectl get pods -n elasticsearch --context=azure
# Port forward Kibana (AWS)
kubectl port-forward -n elasticsearch svc/advanced-elastic-development-aws-elasticsearch-aws 9200:9200 --context=aws
# Port forward Kibana (Azure)
kubectl port-forward -n elasticsearch svc/advanced-elastic-development-aws-elasticsearch-azure 9200:9200 --context=azureFollow the Secrets Setup Guide to configure:
- AWS credentials for each environment
- Azure credentials for each environment
- Environment protection rules
- Deployment permissions
git add .
git commit -m "Initial CI/CD setup"
git push origin develop # Triggers development deployment- View runs in GitHub Actions tab
- Check deployment status in AWS Console
- Check deployment status in Azure Portal
- Monitor Kubernetes resources with kubectl
- Purpose: Local development and testing
- Resources: Multi-cloud (AWS EKS + Azure AKS)
- Auto-deploy: β
On
developbranch - Security: Basic (disabled for development)
- Cloud Providers: AWS (us-west-2) + Azure (West US 2)
- Purpose: Pre-production testing
- Resources: Medium (t3.large instances)
- Auto-deploy: β
On
mainbranch - Security: Production-like with SSL
- Cloud Providers: AWS (us-west-2)
- Purpose: Live production workloads
- Resources: High (m5.large/xlarge instances)
- Auto-deploy: β Manual approval required
- Security: Enterprise-grade with full encryption
- Cloud Providers: AWS (us-west-2)
elastic-terraform/
βββ .github/ # GitHub Actions CI/CD
β βββ workflows/
β β βββ terraform-deploy.yml # Main CI/CD pipeline
β βββ SETUP_SECRETS.md # Secrets configuration guide
βββ environments/ # Environment-specific configs
β βββ development/
β β βββ main.tf # Development environment main config
β β βββ variables.tf # Development environment variables
β β βββ outputs.tf # Development environment outputs
β β βββ terraform.tfvars # Development environment variables
β βββ staging/
β β βββ terraform.tfvars # Staging environment variables
β βββ production/
β βββ terraform.tfvars # Production environment variables
βββ modules/ # Reusable Terraform modules
β βββ eks/ # EKS cluster module
β βββ azure-aks/ # Azure AKS cluster module
β βββ elasticsearch/ # Elasticsearch module
β βββ kibana/ # Kibana module
β βββ monitoring/ # Monitoring stack module
β βββ networking/ # VPC and networking module
β βββ multi-cloud-elasticsearch/ # Multi-cloud Elasticsearch module
βββ elasticsearch-values.yaml # Elasticsearch Helm values
βββ kibana-values.yaml # Kibana Helm values
βββ main.tf # Main Terraform configuration
βββ variables.tf # Variable definitions
βββ outputs.tf # Output values
βββ README.md # This file
- X-Pack Security: Authentication and authorization
- SSL/TLS Encryption: In-transit and at-rest encryption
- RBAC: Role-based access control
- Network Policies: Kubernetes network security
- IAM Integration: AWS IAM roles and policies
- Azure RBAC: Azure role-based access control
- Secret Management: Kubernetes secrets and cloud provider secret management
- Elasticsearch: Centralized logging and search across clouds
- Kibana: Data visualization and management
- Prometheus: Metrics collection
- Grafana: Advanced dashboards
- Alerting: Automated notifications
- Log Aggregation: Centralized log management
- Multi-Cloud Visibility: Cross-cloud monitoring and alerting
- Auto-scaling: Automatic resource scaling based on demand
- Spot Instances: Use of AWS spot instances for non-critical workloads
- Resource Limits: Proper CPU and memory limits
- Storage Optimization: Efficient EBS volume management
- Multi-Cloud Cost Management: Cost tracking across cloud providers
- Monitoring: Cost tracking and optimization recommendations
- Multi-Cloud Connection Issues
# Check AWS Elasticsearch status
kubectl get pods -n elasticsearch --context=aws
# Check Azure Elasticsearch status
kubectl get pods -n elasticsearch --context=azure
# Check cross-cloud connectivity
kubectl logs -n elasticsearch elasticsearch-aws-0 --context=aws
kubectl logs -n elasticsearch elasticsearch-azure-0 --context=azure- Terraform State Issues
# Reinitialize Terraform
terraform init -reconfigure
# Import existing resources
terraform import aws_eks_cluster.main cluster-name
terraform import azurerm_kubernetes_cluster.main cluster-name- CI/CD Pipeline Failures
- Check GitHub Actions logs
- Verify AWS and Azure credentials
- Check environment protection rules
- Verify multi-cloud configuration
- π Documentation
- π Issues
- π¬ Discussions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- HashiCorp Terraform for infrastructure automation
- Elastic for the Elasticsearch stack
- AWS for cloud infrastructure
- Microsoft Azure for cloud infrastructure
- Kubernetes for container orchestration
β Star this repository if you find it helpful!
π Connect with us: