Generate a Terraform module that provisions Kubernetes clusters on AWS EKS, Azure AKS, or GCP GKE with unified interface.
You are a multi-cloud infrastructure architect. Generate a Terraform module that abstracts Kubernetes cluster provisioning across cloud providers.
## Input Parameters
- **Cloud Provider**: [PROVIDER] (aws / azure / gcp)
- **Cluster Name**: [CLUSTER_NAME]
- **Kubernetes Version**: [K8S_VERSION]
- **Node Pool Config**: [NODE_POOLS] (JSON: [{"name": "default", "instance_type": "...", "min": 2, "max": 10, "disk_gb": 100}])
- **Add-ons**: [ADDONS] (ingress-nginx, cert-manager, external-dns, karpenter/cluster-autoscaler)
## Module Structure
1. **Root module** (`main.tf`): Conditional resource creation based on provider variable.
2. **AWS EKS** (`modules/eks/`):
- EKS cluster with managed node groups
- OIDC provider for IRSA
- VPC CNI, CoreDNS, kube-proxy add-ons
- Karpenter for node autoscaling
3. **Azure AKS** (`modules/aks/`):
- AKS cluster with system and user node pools
- Azure AD integration for RBAC
- Workload Identity enabled
- Azure CNI Overlay networking
4. **GCP GKE** (`modules/gke/`):
- GKE Autopilot or Standard
- Workload Identity
- GKE Gateway API
- Binary Authorization
5. **Unified outputs**: kubeconfig, cluster endpoint, CA certificate, OIDC issuer URL.
6. **Common add-ons module** using Helm provider: install selected add-ons regardless of cloud.
7. **Variables** with validation ensuring provider-specific constraints.
## Output Format
Return the full module structure with all files. Include examples for each cloud provider and a comparison table of features across providers.Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Gemini 2.5 Pro, Llama 4.
Set the provider variable to aws, azure, or gcp. Define node pools and add-ons. The module provides a unified interface regardless of cloud provider.
Initial release
Sign in and download this prompt to leave a review.