Skip to content

Commit

Permalink
tflint infrastructure folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandra Reddy authored and Chandra Reddy committed Aug 2, 2024
1 parent 95fcf2d commit f8a7dc1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 52 deletions.
6 changes: 6 additions & 0 deletions infrastructure/01_provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ provider "helm" {
}
}

provider "random" {}

terraform {
required_version = "~> 1.7"
required_providers {
Expand All @@ -32,5 +34,9 @@ terraform {
source = "hashicorp/helm"
version = "~> 2.14.0"
}
random = {
source = "hashicorp/random"
version = "3.6.2"
}
}
}
6 changes: 0 additions & 6 deletions infrastructure/03_vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ resource "aws_resourcegroups_group" "main" {
}
}

data "aws_partition" "current" {}
data "aws_caller_identity" "current" {}


data "aws_availability_zones" "available" {
state = "available"
}
Expand All @@ -51,7 +47,6 @@ resource "random_shuffle" "az" {

locals {
azs_random = random_shuffle.az.result
azs_slice = slice(data.aws_availability_zones.available.names, 0, var.az_count)

public_subnets = { for k, v in local.azs_random :
k => {
Expand All @@ -65,5 +60,4 @@ locals {
availability_zone = v
}
}
partition = data.aws_partition.current.partition
}
10 changes: 0 additions & 10 deletions infrastructure/04_iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,3 @@ resource "aws_iam_role_policy_attachment" "eks_cluster_policy" {
role = aws_iam_role.container_cluster.name
}

data "aws_iam_policy_document" "container_node_group" {
statement {
sid = "EKSNodeAssumeRole"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
}
}
}
36 changes: 0 additions & 36 deletions infrastructure/98_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,6 @@ variable "az_count" {
default = 1
}

variable "cluster_name" {
description = "EKS cluster name"
type = string
default = "cm-appfolio"
}

variable "cluster_version" {
type = number
description = "EKS cluster version"
default = "1.29"
}

variable "desired_capacity" {
type = number
description = "Desired number of worker nodes"
default = 3
}

variable "min_node_count" {
description = "Minimum number of worker nodes"
type = number
default = 2
}

variable "max_node_count" {
description = "Maximum number of worker nodes"
type = number
default = 4
}

variable "instance_type" {
description = "EC2 instance type for worker nodes"
default = ["t2.small"]
type = list(any)
}

variable "db_name" {
description = "The database name"
type = string
Expand Down

0 comments on commit f8a7dc1

Please sign in to comment.