Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmebee committed May 20, 2022
1 parent db414d4 commit 88732f0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nginx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "helm_release" "nginx" {

set {
name = "replicaCount"
value = "3"
value = var.replica
}

depends_on = [
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ variable "namespace" {
description = "kubernetes namespace"
}

variable "tag" {
type = string
default = "terraform-eks-cluster"
description = "tag for aws resources"
}

variable "kubernetes_version" {
type = string
default = "1.22"
Expand Down Expand Up @@ -40,3 +46,9 @@ variable "nginx_version" {
default = "4.1.0"
description = "nginx chart version"
}

variable "replica" {
type = string
default = "3"
description = "number of nginx replica"
}
10 changes: 7 additions & 3 deletions vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ data "aws_region" "current" {
data "aws_availability_zones" "available" {
}

locals {
tag = var.tag
}

resource "aws_vpc" "this" {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tags = {
"Name" = "terraform-eks-cluster"
Name = local.tag
}
}

Expand All @@ -26,15 +30,15 @@ resource "aws_subnet" "this" {
map_public_ip_on_launch = true

tags = {
"Name" = "terraform-eks-cluster"
Name = local.tag
}
}

resource "aws_internet_gateway" "this" {
vpc_id = aws_vpc.this.id

tags = {
Name = "terraform-eks-cluster"
Name = local.tag
}
}

Expand Down

0 comments on commit 88732f0

Please sign in to comment.