Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform eks #38

Merged
merged 26 commits into from
Oct 20, 2023
Merged

Terraform eks #38

merged 26 commits into from
Oct 20, 2023

Conversation

Rithin-QB
Copy link
Collaborator

@Rithin-QB Rithin-QB commented Oct 10, 2023

Terraform Plan:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

module.eks.aws_eks_cluster.default will be created

  • resource "aws_eks_cluster" "default" {
    • arn = (known after apply)

    • certificate_authority = (known after apply)

    • cluster_id = (known after apply)

    • created_at = (known after apply)

    • endpoint = (known after apply)

    • id = (known after apply)

    • identity = (known after apply)

    • name = "my-eks-cluster"

    • platform_version = (known after apply)

    • role_arn = (known after apply)

    • status = (known after apply)

    • tags_all = {

      • "Environment" = "Test"
      • "Project" = "QBurst"
        }
    • version = "1.24"

    • vpc_config {

      • cluster_security_group_id = (known after apply)
      • endpoint_private_access = false
      • endpoint_public_access = true
      • public_access_cidrs = (known after apply)
      • security_group_ids = (known after apply)
      • subnet_ids = (known after apply)
      • vpc_id = (known after apply)
        }
        }

module.eks.aws_eks_node_group.nodes_general will be created

  • resource "aws_eks_node_group" "nodes_general" {
    • ami_type = "AL2_x86_64"

    • arn = (known after apply)

    • capacity_type = "ON_DEMAND"

    • cluster_name = "my-eks-cluster"

    • disk_size = 20

    • force_update_version = false

    • id = (known after apply)

    • instance_types = [

      • "t3.small",
        ]
    • labels = {

      • "role" = "nodes_general"
        }
    • node_group_name = "nodes-general"

    • node_group_name_prefix = (known after apply)

    • node_role_arn = (known after apply)

    • release_version = (known after apply)

    • resources = (known after apply)

    • status = (known after apply)

    • subnet_ids = (known after apply)

    • tags_all = {

      • "Environment" = "Test"
      • "Project" = "QBurst"
        }
    • version = "1.24"

    • scaling_config {

      • desired_size = 1
      • max_size = 2
      • min_size = 1
        }
        }

module.eks.aws_iam_role.default will be created

  • resource "aws_iam_role" "default" {
    • arn = (known after apply)
    • assume_role_policy = jsonencode(
      {
      + Statement = [
      + {
      + Action = "sts:AssumeRole"
      + Effect = "Allow"
      + Principal = {
      + Service = "eks.amazonaws.com"
      }
      },
      ]
      + Version = "2012-10-17"
      }
      )
    • create_date = (known after apply)
    • force_detach_policies = false
    • id = (known after apply)
    • managed_policy_arns = (known after apply)
    • max_session_duration = 3600
    • name = "eks-cluster-role"
    • name_prefix = (known after apply)
    • path = "/"
    • tags_all = {
      • "Environment" = "Test"
      • "Project" = "QBurst"
        }
    • unique_id = (known after apply)
      }

module.eks.aws_iam_role.nodes_general will be created

  • resource "aws_iam_role" "nodes_general" {
    • arn = (known after apply)
    • assume_role_policy = jsonencode(
      {
      + Statement = [
      + {
      + Action = "sts:AssumeRole"
      + Effect = "Allow"
      + Principal = {
      + Service = "ec2.amazonaws.com"
      }
      },
      ]
      + Version = "2012-10-17"
      }
      )
    • create_date = (known after apply)
    • force_detach_policies = false
    • id = (known after apply)
    • managed_policy_arns = (known after apply)
    • max_session_duration = 3600
    • name = "eks-node-groupgeneral"
    • name_prefix = (known after apply)
    • path = "/"
    • tags_all = {
      • "Environment" = "Test"
      • "Project" = "QBurst"
        }
    • unique_id = (known after apply)
      }

module.eks.aws_iam_role_policy_attachment.amazon_ec2_container_registry_read_only_policy will be created

  • resource "aws_iam_role_policy_attachment" "amazon_ec2_container_registry_read_only_policy" {
    • id = (known after apply)
    • policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
    • role = "eks-node-groupgeneral"
      }

module.eks.aws_iam_role_policy_attachment.amazon_eks_cni_policy_general will be created

  • resource "aws_iam_role_policy_attachment" "amazon_eks_cni_policy_general" {
    • id = (known after apply)
    • policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
    • role = "eks-node-groupgeneral"
      }

module.eks.aws_iam_role_policy_attachment.amazon_eks_worker_node_policy_general will be created

  • resource "aws_iam_role_policy_attachment" "amazon_eks_worker_node_policy_general" {
    • id = (known after apply)
    • policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
    • role = "eks-node-groupgeneral"
      }

module.eks.aws_iam_role_policy_attachment.default_amazon_eks_cluster_policy will be created

  • resource "aws_iam_role_policy_attachment" "default_amazon_eks_cluster_policy" {
    • id = (known after apply)
    • policy_arn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy"
    • role = "eks-cluster-role"
      }

module.eks.aws_security_group.eks_cluster_sg will be created

  • resource "aws_security_group" "eks_cluster_sg" {
    • arn = (known after apply)
    • description = "EKS Cluster Security Group"
    • egress = [
      • {
        • cidr_blocks = [
          • "0.0.0.0/0",
            ]
        • description = ""
        • from_port = 0
        • ipv6_cidr_blocks = []
        • prefix_list_ids = []
        • protocol = "-1"
        • security_groups = []
        • self = false
        • to_port = 0
          },
          ]
    • id = (known after apply)
    • ingress = [
      • {
        • cidr_blocks = [
          • "0.0.0.0/0",
            ]
        • description = ""
        • from_port = 22
        • ipv6_cidr_blocks = []
        • prefix_list_ids = []
        • protocol = "tcp"
        • security_groups = []
        • self = false
        • to_port = 22
          },
      • {
        • cidr_blocks = []
        • description = ""
        • from_port = 443
        • ipv6_cidr_blocks = []
        • prefix_list_ids = []
        • protocol = "tcp"
        • security_groups = []
        • self = false
        • to_port = 443
          },
      • {
        • cidr_blocks = []
        • description = ""
        • from_port = 80
        • ipv6_cidr_blocks = []
        • prefix_list_ids = []
        • protocol = "tcp"
        • security_groups = []
        • self = false
        • to_port = 80
          },
          ]
    • name = "eks-cluster-sg"
    • name_prefix = (known after apply)
    • owner_id = (known after apply)
    • revoke_rules_on_delete = false
    • tags_all = {
      • "Environment" = "Test"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_eip.nat_gw[0] will be created

  • resource "aws_eip" "nat_gw" {
    • allocation_id = (known after apply)
    • association_id = (known after apply)
    • carrier_ip = (known after apply)
    • customer_owned_ip = (known after apply)
    • domain = (known after apply)
    • id = (known after apply)
    • instance = (known after apply)
    • network_border_group = (known after apply)
    • network_interface = (known after apply)
    • private_dns = (known after apply)
    • private_ip = (known after apply)
    • public_dns = (known after apply)
    • public_ip = (known after apply)
    • public_ipv4_pool = (known after apply)
    • tags = {
      • "Name" = "qburst-nat-eip"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-nat-eip"
      • "Project" = "QBurst"
        }
    • vpc = true
      }

module.vpc.aws_internet_gateway.default[0] will be created

  • resource "aws_internet_gateway" "default" {
    • arn = (known after apply)
    • id = (known after apply)
    • owner_id = (known after apply)
    • tags = {
      • "Name" = "qburst-igw"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-igw"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_nat_gateway.default[0] will be created

  • resource "aws_nat_gateway" "default" {
    • allocation_id = (known after apply)
    • association_id = (known after apply)
    • connectivity_type = "public"
    • id = (known after apply)
    • network_interface_id = (known after apply)
    • private_ip = (known after apply)
    • public_ip = (known after apply)
    • secondary_private_ip_address_count = (known after apply)
    • secondary_private_ip_addresses = (known after apply)
    • subnet_id = (known after apply)
    • tags = {
      • "Name" = "qburst-nat-gw"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-nat-gw"
      • "Project" = "QBurst"
        }
        }

module.vpc.aws_route.internet_gateway[0] will be created

  • resource "aws_route" "internet_gateway" {
    • destination_cidr_block = "0.0.0.0/0"
    • gateway_id = (known after apply)
    • id = (known after apply)
    • instance_id = (known after apply)
    • instance_owner_id = (known after apply)
    • network_interface_id = (known after apply)
    • origin = (known after apply)
    • route_table_id = (known after apply)
    • state = (known after apply)
      }

module.vpc.aws_route.internet_gateway[1] will be created

  • resource "aws_route" "internet_gateway" {
    • destination_cidr_block = "0.0.0.0/0"
    • gateway_id = (known after apply)
    • id = (known after apply)
    • instance_id = (known after apply)
    • instance_owner_id = (known after apply)
    • network_interface_id = (known after apply)
    • origin = (known after apply)
    • route_table_id = (known after apply)
    • state = (known after apply)
      }

module.vpc.aws_route.nat_gateway[0] will be created

  • resource "aws_route" "nat_gateway" {
    • destination_cidr_block = "0.0.0.0/0"
    • id = (known after apply)
    • instance_id = (known after apply)
    • instance_owner_id = (known after apply)
    • nat_gateway_id = (known after apply)
    • network_interface_id = (known after apply)
    • origin = (known after apply)
    • route_table_id = (known after apply)
    • state = (known after apply)
      }

module.vpc.aws_route.nat_gateway[1] will be created

  • resource "aws_route" "nat_gateway" {
    • destination_cidr_block = "0.0.0.0/0"
    • id = (known after apply)
    • instance_id = (known after apply)
    • instance_owner_id = (known after apply)
    • nat_gateway_id = (known after apply)
    • network_interface_id = (known after apply)
    • origin = (known after apply)
    • route_table_id = (known after apply)
    • state = (known after apply)
      }

module.vpc.aws_route_table.private[0] will be created

  • resource "aws_route_table" "private" {
    • arn = (known after apply)
    • id = (known after apply)
    • owner_id = (known after apply)
    • propagating_vgws = (known after apply)
    • route = (known after apply)
    • tags = {
      • "Name" = "qburst-private-route-table-0"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-private-route-table-0"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_route_table.private[1] will be created

  • resource "aws_route_table" "private" {
    • arn = (known after apply)
    • id = (known after apply)
    • owner_id = (known after apply)
    • propagating_vgws = (known after apply)
    • route = (known after apply)
    • tags = {
      • "Name" = "qburst-private-route-table-1"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-private-route-table-1"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_route_table.public[0] will be created

  • resource "aws_route_table" "public" {
    • arn = (known after apply)
    • id = (known after apply)
    • owner_id = (known after apply)
    • propagating_vgws = (known after apply)
    • route = (known after apply)
    • tags = {
      • "Name" = "qburst-public-route-table-0"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-public-route-table-0"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_route_table.public[1] will be created

  • resource "aws_route_table" "public" {
    • arn = (known after apply)
    • id = (known after apply)
    • owner_id = (known after apply)
    • propagating_vgws = (known after apply)
    • route = (known after apply)
    • tags = {
      • "Name" = "qburst-public-route-table-1"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-public-route-table-1"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_route_table_association.private[0] will be created

  • resource "aws_route_table_association" "private" {
    • id = (known after apply)
    • route_table_id = (known after apply)
    • subnet_id = (known after apply)
      }

module.vpc.aws_route_table_association.private[1] will be created

  • resource "aws_route_table_association" "private" {
    • id = (known after apply)
    • route_table_id = (known after apply)
    • subnet_id = (known after apply)
      }

module.vpc.aws_route_table_association.public[0] will be created

  • resource "aws_route_table_association" "public" {
    • id = (known after apply)
    • route_table_id = (known after apply)
    • subnet_id = (known after apply)
      }

module.vpc.aws_route_table_association.public[1] will be created

  • resource "aws_route_table_association" "public" {
    • id = (known after apply)
    • route_table_id = (known after apply)
    • subnet_id = (known after apply)
      }

module.vpc.aws_subnet.private[0] will be created

  • resource "aws_subnet" "private" {
    • arn = (known after apply)
    • assign_ipv6_address_on_creation = false
    • availability_zone = "us-east-1a"
    • availability_zone_id = (known after apply)
    • cidr_block = "10.0.0.0/19"
    • enable_dns64 = false
    • enable_resource_name_dns_a_record_on_launch = false
    • enable_resource_name_dns_aaaa_record_on_launch = false
    • id = (known after apply)
    • ipv6_cidr_block_association_id = (known after apply)
    • ipv6_native = false
    • map_public_ip_on_launch = false
    • owner_id = (known after apply)
    • private_dns_hostname_type_on_launch = (known after apply)
    • tags = {
      • "Name" = "qburst-private-0"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-private-0"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_subnet.private[1] will be created

  • resource "aws_subnet" "private" {
    • arn = (known after apply)
    • assign_ipv6_address_on_creation = false
    • availability_zone = "us-east-1b"
    • availability_zone_id = (known after apply)
    • cidr_block = "10.0.32.0/19"
    • enable_dns64 = false
    • enable_resource_name_dns_a_record_on_launch = false
    • enable_resource_name_dns_aaaa_record_on_launch = false
    • id = (known after apply)
    • ipv6_cidr_block_association_id = (known after apply)
    • ipv6_native = false
    • map_public_ip_on_launch = false
    • owner_id = (known after apply)
    • private_dns_hostname_type_on_launch = (known after apply)
    • tags = {
      • "Name" = "qburst-private-1"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-private-1"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_subnet.public[0] will be created

  • resource "aws_subnet" "public" {
    • arn = (known after apply)
    • assign_ipv6_address_on_creation = false
    • availability_zone = "us-east-1a"
    • availability_zone_id = (known after apply)
    • cidr_block = "10.0.64.0/19"
    • enable_dns64 = false
    • enable_resource_name_dns_a_record_on_launch = false
    • enable_resource_name_dns_aaaa_record_on_launch = false
    • id = (known after apply)
    • ipv6_cidr_block_association_id = (known after apply)
    • ipv6_native = false
    • map_public_ip_on_launch = true
    • owner_id = (known after apply)
    • private_dns_hostname_type_on_launch = (known after apply)
    • tags = {
      • "Name" = "qburst-public-0"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-public-0"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_subnet.public[1] will be created

  • resource "aws_subnet" "public" {
    • arn = (known after apply)
    • assign_ipv6_address_on_creation = false
    • availability_zone = "us-east-1b"
    • availability_zone_id = (known after apply)
    • cidr_block = "10.0.96.0/19"
    • enable_dns64 = false
    • enable_resource_name_dns_a_record_on_launch = false
    • enable_resource_name_dns_aaaa_record_on_launch = false
    • id = (known after apply)
    • ipv6_cidr_block_association_id = (known after apply)
    • ipv6_native = false
    • map_public_ip_on_launch = true
    • owner_id = (known after apply)
    • private_dns_hostname_type_on_launch = (known after apply)
    • tags = {
      • "Name" = "qburst-public-1"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-public-1"
      • "Project" = "QBurst"
        }
    • vpc_id = (known after apply)
      }

module.vpc.aws_vpc.default will be created

  • resource "aws_vpc" "default" {
    • arn = (known after apply)
    • cidr_block = "10.0.0.0/16"
    • default_network_acl_id = (known after apply)
    • default_route_table_id = (known after apply)
    • default_security_group_id = (known after apply)
    • dhcp_options_id = (known after apply)
    • enable_dns_hostnames = true
    • enable_dns_support = true
    • enable_network_address_usage_metrics = (known after apply)
    • id = (known after apply)
    • instance_tenancy = "default"
    • ipv6_association_id = (known after apply)
    • ipv6_cidr_block = (known after apply)
    • ipv6_cidr_block_network_border_group = (known after apply)
    • main_route_table_id = (known after apply)
    • owner_id = (known after apply)
    • tags = {
      • "Name" = "qburst-vpc"
        }
    • tags_all = {
      • "Environment" = "Test"
      • "Name" = "qburst-vpc"
      • "Project" = "QBurst"
        }
        }

Plan: 29 to add, 0 to change, 0 to destroy.

terraform/aws/modules/eks/subnets.tf Outdated Show resolved Hide resolved
terraform/aws/modules/eks/eks.tf Outdated Show resolved Hide resolved
terraform/aws/modules/eks/eks-node-group.tf Outdated Show resolved Hide resolved
terraform/aws/modules/eks/eks-node-group.tf Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@Rithin-QB Rithin-QB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have resolved the review comments.
Have reused the existing modules and made the required properties configurable by passing variables.

terraform/aws/modules/eks/eks-node-group.tf Show resolved Hide resolved
terraform/aws/modules/eks/eks.tf Outdated Show resolved Hide resolved
terraform/aws/modules/eks/vpc.tf Outdated Show resolved Hide resolved
terraform/aws/modules/eks/eks.tf Show resolved Hide resolved
Copy link
Collaborator Author

@Rithin-QB Rithin-QB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have updated the module as mentioned in the comments in the PR.

@qburst-praven qburst-praven self-requested a review October 20, 2023 07:35
@elson-ae elson-ae removed their request for review October 20, 2023 08:11
@Rithin-QB Rithin-QB merged commit c2a5766 into main Oct 20, 2023
@Rithin-QB Rithin-QB deleted the terraform-eks branch October 20, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants