Difference between revisions of "Terraform module: vpc"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
  https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest
 
  https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest
  
<pre>
 
module "vpc" {
 
  source  = "terraform-aws-modules/vpc/aws"
 
  version = "3.2.0"
 
  
  name                = "education-vpc"
+
module "vpc" {
  cidr                = "10.0.0.0/16"
+
  source  = "terraform-aws-modules/vpc/aws"
  azs                  = data.aws_availability_zones.available.names
+
  version = "3.2.0"
  private_subnets      = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
+
  public_subnets      = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
+
  name                = "education-vpc"
  enable_nat_gateway  = true
+
  cidr                = "10.0.0.0/16"
  single_nat_gateway  = true
+
  azs                  = data.aws_availability_zones.available.names
  enable_dns_hostnames = true
+
  private_subnets      = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
 +
  public_subnets      = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
 +
  enable_nat_gateway  = true
 +
  single_nat_gateway  = true
 +
  enable_dns_hostnames = true  
 +
 +
  tags = {
 +
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
 +
  }
 +
 +
  public_subnet_tags = {
 +
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
 +
    "kubernetes.io/role/elb"                      = "1"
 +
  }
 +
 +
  private_subnet_tags = {
 +
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
 +
    "kubernetes.io/role/internal-elb"            = "1"
 +
  }
 +
}
  
  tags = {
 
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
 
  }
 
 
  public_subnet_tags = {
 
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
 
    "kubernetes.io/role/elb"                      = "1"
 
  }
 
 
  private_subnet_tags = {
 
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
 
    "kubernetes.io/role/internal-elb"            = "1"
 
  }
 
}
 
</pre>
 
  
 
== Related ==
 
== Related ==

Revision as of 10:58, 2 June 2022

https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest


module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "3.2.0"

  name                 = "education-vpc"
  cidr                 = "10.0.0.0/16"
  azs                  = data.aws_availability_zones.available.names
  private_subnets      = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
  public_subnets       = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
  enable_nat_gateway   = true
  single_nat_gateway   = true
  enable_dns_hostnames = true 

  tags = {
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
  }

  public_subnet_tags = {
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
    "kubernetes.io/role/elb"                      = "1"
  }

  private_subnet_tags = {
    "kubernetes.io/cluster/${local.cluster_name}" = "shared"
    "kubernetes.io/role/internal-elb"             = "1"
  }
}


Related

See also

Advertising: