github.com/replicatedhq/ship@v0.55.0/integration/base/amazon-eks/expected/installer/new/new_vpc.tf (about)

     1  
     2  variable "vpc_cidr" {
     3    type    = "string"
     4    default = "10.0.0.0/16"
     5  }
     6  
     7  variable "vpc_public_subnets" {
     8    default = [
     9      "10.0.1.0/24",
    10      "10.0.2.0/24",
    11    ]
    12  }
    13  
    14  variable "vpc_private_subnets" {
    15    default = [
    16      "10.0.129.0/24",
    17      "10.0.130.0/24",
    18    ]
    19  }
    20  
    21  variable "vpc_azs" {
    22    default = [
    23      "us-west-2a",
    24      "us-west-2b",
    25    ]
    26  }
    27  
    28  module "vpc" {
    29    source  = "terraform-aws-modules/vpc/aws"
    30    version = "1.60.0"
    31    name    = "eks-vpc"
    32    cidr    = "${var.vpc_cidr}"
    33    azs     = "${var.vpc_azs}"
    34  
    35    private_subnets = "${var.vpc_private_subnets}"
    36    public_subnets  = "${var.vpc_public_subnets}"
    37  
    38    map_public_ip_on_launch = true
    39    enable_nat_gateway      = true
    40    single_nat_gateway      = true
    41  
    42    tags = "${map("kubernetes.io/cluster/${var.eks-cluster-name}", "shared")}"
    43  }
    44  
    45  locals {
    46    "eks_vpc"                 = "${module.vpc.vpc_id}"
    47    "eks_vpc_public_subnets"  = "${module.vpc.public_subnets}"
    48    "eks_vpc_private_subnets" = "${module.vpc.private_subnets}"
    49  }
    50  
    51  locals {
    52    "worker_group_count" = "2"
    53  }
    54  
    55  locals {
    56    "worker_groups" = [
    57      {
    58        name                 = "alpha"
    59        asg_min_size         = "3"
    60        asg_max_size         = "3"
    61        asg_desired_capacity = "3"
    62        instance_type        = "m5.2xlarge"
    63  
    64        subnets = "${join(",", local.eks_vpc_private_subnets)}"
    65      },
    66      {
    67        name                 = "bravo"
    68        asg_min_size         = "1"
    69        asg_max_size         = "1"
    70        asg_desired_capacity = "1"
    71        instance_type        = "m5.4xlarge"
    72  
    73        subnets = "${join(",", local.eks_vpc_private_subnets)}"
    74      },
    75    ]
    76  }
    77  
    78  provider "aws" {
    79    version = "~> 2.7.0"
    80    region  = "us-west-2"
    81  }
    82  
    83  variable "eks-cluster-name" {
    84    default = "new-vpc-cluster"
    85    type    = "string"
    86  }
    87  
    88  module "eks" {
    89    source  = "terraform-aws-modules/eks/aws"
    90    version = "3.0.0"
    91  
    92    cluster_name = "${var.eks-cluster-name}"
    93  
    94    subnets = ["${local.eks_vpc_private_subnets}", "${local.eks_vpc_public_subnets}"]
    95  
    96    vpc_id = "${local.eks_vpc}"
    97  
    98    worker_group_count = "${local.worker_group_count}"
    99    worker_groups      = "${local.worker_groups}"
   100  }