# Providers provider "aws" { region = var.aws_region } provider "kubernetes" { host = module.eks.cluster_endpoint cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) token = data.aws_eks_cluster_auth.this.token } provider "helm" { kubernetes { host = module.eks.cluster_endpoint cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) token = data.aws_eks_cluster_auth.this.token } } provider "kubectl" { apply_retry_count = 10 host = module.eks.cluster_endpoint cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data) token = data.aws_eks_cluster_auth.this.token } # Data data "aws_eks_cluster_auth" "this" { name = module.eks.cluster_name } data "aws_availability_zones" "available" {} data "http" "efa_device_plugin_yaml" { url = "https://raw.githubusercontent.com/aws-samples/aws-efa-eks/main/manifest/efa-k8s-device-plugin.yml" } data "aws_ami" "eks_gpu_node" { most_recent = true owners = ["amazon"] filter { name = "name" values = ["amazon-eks-gpu-node-${local.cluster_version}-*"] } } # Local config locals { name = var.cluster_name cluster_version = "1.25" vpc_cidr = "10.11.0.0/16" azs = slice(data.aws_availability_zones.available.names, 0, 2) tags = { Blueprint = local.name GithubRepo = "github.com/aws-ia/terraform-aws-eks-blueprints" } } # Resources resource "aws_placement_group" "efa_pg" { name = "efa_pg" strategy = "cluster" } resource "kubectl_manifest" "efa_device_plugin" { yaml_body = <