diff --git a/infrastructure/01_provider.tf b/infrastructure/01_provider.tf index d3b5ee8..0978330 100644 --- a/infrastructure/01_provider.tf +++ b/infrastructure/01_provider.tf @@ -17,6 +17,8 @@ provider "helm" { } } +provider "random" {} + terraform { required_version = "~> 1.7" required_providers { @@ -32,5 +34,9 @@ terraform { source = "hashicorp/helm" version = "~> 2.14.0" } + random = { + source = "hashicorp/random" + version = "3.6.2" + } } } diff --git a/infrastructure/03_vpc.tf b/infrastructure/03_vpc.tf index 9df9dda..ec80dd4 100644 --- a/infrastructure/03_vpc.tf +++ b/infrastructure/03_vpc.tf @@ -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" } @@ -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 => { @@ -65,5 +60,4 @@ locals { availability_zone = v } } - partition = data.aws_partition.current.partition } diff --git a/infrastructure/04_iam.tf b/infrastructure/04_iam.tf index 94aa8ac..0cb1cd0 100644 --- a/infrastructure/04_iam.tf +++ b/infrastructure/04_iam.tf @@ -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"] - } - } -} diff --git a/infrastructure/98_variables.tf b/infrastructure/98_variables.tf index bea7522..b7c3cc3 100644 --- a/infrastructure/98_variables.tf +++ b/infrastructure/98_variables.tf @@ -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