diff --git a/EKS_Terraform/main.tf b/EKS_Terraform/main.tf deleted file mode 100644 index cf18a035..00000000 --- a/EKS_Terraform/main.tf +++ /dev/null @@ -1,175 +0,0 @@ -provider "aws" { - region = "ap-south-1" -} - -resource "aws_vpc" "devopsshack_vpc" { - cidr_block = "10.0.0.0/16" - - tags = { - Name = "devopsshack-vpc" - } -} - -resource "aws_subnet" "devopsshack_subnet" { - count = 2 - vpc_id = aws_vpc.devopsshack_vpc.id - cidr_block = cidrsubnet(aws_vpc.devopsshack_vpc.cidr_block, 8, count.index) - availability_zone = element(["ap-south-1a", "ap-south-1b"], count.index) - map_public_ip_on_launch = true - - tags = { - Name = "devopsshack-subnet-${count.index}" - } -} - -resource "aws_internet_gateway" "devopsshack_igw" { - vpc_id = aws_vpc.devopsshack_vpc.id - - tags = { - Name = "devopsshack-igw" - } -} - -resource "aws_route_table" "devopsshack_route_table" { - vpc_id = aws_vpc.devopsshack_vpc.id - - route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.devopsshack_igw.id - } - - tags = { - Name = "devopsshack-route-table" - } -} - -resource "aws_route_table_association" "a" { - count = 2 - subnet_id = aws_subnet.devopsshack_subnet[count.index].id - route_table_id = aws_route_table.devopsshack_route_table.id -} - -resource "aws_security_group" "devopsshack_cluster_sg" { - vpc_id = aws_vpc.devopsshack_vpc.id - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = { - Name = "devopsshack-cluster-sg" - } -} - -resource "aws_security_group" "devopsshack_node_sg" { - vpc_id = aws_vpc.devopsshack_vpc.id - - ingress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = { - Name = "devopsshack-node-sg" - } -} - -resource "aws_eks_cluster" "devopsshack" { - name = "devopsshack-cluster" - role_arn = aws_iam_role.devopsshack_cluster_role.arn - - vpc_config { - subnet_ids = aws_subnet.devopsshack_subnet[*].id - security_group_ids = [aws_security_group.devopsshack_cluster_sg.id] - } -} - -resource "aws_eks_node_group" "devopsshack" { - cluster_name = aws_eks_cluster.devopsshack.name - node_group_name = "devopsshack-node-group" - node_role_arn = aws_iam_role.devopsshack_node_group_role.arn - subnet_ids = aws_subnet.devopsshack_subnet[*].id - - scaling_config { - desired_size = 3 - max_size = 3 - min_size = 3 - } - - instance_types = ["t2.large"] - - remote_access { - ec2_ssh_key = var.ssh_key_name - source_security_group_ids = [aws_security_group.devopsshack_node_sg.id] - } -} - -resource "aws_iam_role" "devopsshack_cluster_role" { - name = "devopsshack-cluster-role" - - assume_role_policy = < maven-releases - http://13.235.245.200:8081/repository/maven-releases/ + http://23.22.137.160:8081/repository/maven-releases/ maven-snapshots - http://13.235.245.200:8081/repository/maven-snapshots/ + http://23.22.137.160:8081/repository/maven-snapshots/