# # EKS Cluster Resources # * IAM Role to allow EKS service to manage other AWS services # * EC2 Security Group to allow networking traffic with EKS cluster # * EKS Cluster # resource "aws_eks_cluster" "demo" { name = "${var.cluster_name}" role_arn = "${aws_iam_role.demo-cluster.arn}" vpc_config { security_group_ids = ["${aws_security_group.demo-cluster.id}"] subnet_ids = ["${var.subnets}"] } depends_on = [ "aws_iam_role_policy_attachment.demo-cluster-AmazonEKSClusterPolicy", "aws_iam_role_policy_attachment.demo-cluster-AmazonEKSServicePolicy", ] } resource "aws_iam_role" "demo-cluster" { name = "terraform-eks-demo-cluster" assume_role_policy = <