Skip to content

Commit 32e438c

Browse files
committed
Create main.tf
0 parents  commit 32e438c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

main.tf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
provider "aws" {
2+
profile = "default" # (Optional) This is the AWS profile name as set in the shared credentials file
3+
region = "us-east-1" # (Required) AWS region
4+
}
5+
6+
resource "aws_eks_cluster" "example" {
7+
name = "a-cluster" # (Required) Name of the cluster
8+
role_arn = "arn:aws:iam::123:role/eks-poc-eks-cluster-role" # (Required) ARN of the IAM role that provides permissions for the Kubernetes
9+
10+
vpc_config { # (Required) Configuration block for the VPC associated with your cluster
11+
subnet_ids = ["subnet-12345678901", "subnet-12345678901"] # (Required) List of subnet IDs
12+
}
13+
}
14+
15+
resource "aws_eks_node_group" "a-ng" {
16+
cluster_name = "a-cluster" # (Required) Name of the EKS Cluster
17+
node_group_name = "t3_medium-node_group" # (Optional) Name of the EKS Node Group
18+
node_role_arn = "arn:aws:iam::123:role/eks-poc-eks-nodegroup-role" # (Required) Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group
19+
subnet_ids = ["subnet-12345678901", "subnet-12345678901"] # (Required) Identifiers of EC2 Subnets to associate with the EKS Node Group
20+
ami_type = "AL2_x86_64" # (Optional) Type of Amazon Machine Image (AMI) associated with the EKS Node Group
21+
instance_types = ["t3.medium"] # (Optional) List of instance types associated with the EKS Node Group. Default: ["t3.medium"]
22+
capacity_type = "ON_DEMAND" # (Optional) Type of capacity associated with the EKS Node Group. Valid values: ON_DEMAND, SPOT
23+
disk_size = 20 # (Optional) Disk size in GiB for worker nodes. Default: 20 (GiB)
24+
25+
scaling_config { # (Required) Configuration block with scaling settings
26+
desired_size = 2 # (Required) Desired number of worker nodes
27+
max_size = 2 # (Required) Maximum number of worker nodes
28+
min_size = 1 # (Required) Minimum number of worker nodes
29+
}
30+
}

0 commit comments

Comments
 (0)