diff options
| author | Saumit <justsaumit@protonmail.com> | 2025-09-28 04:34:29 +0530 |
|---|---|---|
| committer | Saumit <justsaumit@protonmail.com> | 2025-09-28 04:34:29 +0530 |
| commit | 90a62ae7ea5e745b99d8ac8d08ae837bbaedfce5 (patch) | |
| tree | 97c9029d875f13288392bb8af4fb270067e4939a /astroshop-terraform | |
| parent | c91e833ccba15a311e23cc21709cdefaf90b4398 (diff) | |
backend: Refactor formatting in main.tf and variables.tf, add terraform.tfvars for configuration
Diffstat (limited to 'astroshop-terraform')
| -rw-r--r-- | astroshop-terraform/backend.tf | 8 | ||||
| -rw-r--r-- | astroshop-terraform/main.tf | 16 | ||||
| -rw-r--r-- | astroshop-terraform/terraform.tfvars | 29 | ||||
| -rw-r--r-- | astroshop-terraform/variables.tf | 4 |
4 files changed, 42 insertions, 15 deletions
diff --git a/astroshop-terraform/backend.tf b/astroshop-terraform/backend.tf index d962b6b..f643e10 100644 --- a/astroshop-terraform/backend.tf +++ b/astroshop-terraform/backend.tf @@ -19,11 +19,9 @@ resource "aws_s3_bucket_versioning" "terraform_state" { resource "aws_s3_bucket_server_side_encryption_configuration" "terraform_state" { bucket = aws_s3_bucket.terraform_state.id - server_side_encryption_configuration { - rule { - apply_server_side_encryption_by_default { - sse_algorithm = "AES256" - } + rule { + apply_server_side_encryption_by_default { + sse_algorithm = "AES256" } } } diff --git a/astroshop-terraform/main.tf b/astroshop-terraform/main.tf index 45e0756..1fc3fb5 100644 --- a/astroshop-terraform/main.tf +++ b/astroshop-terraform/main.tf @@ -11,15 +11,15 @@ module "vpc" { module "eks" { source = "./modules/eks" - cluster_name = var.cluster_name - cluster_version = var.cluster_version - vpc_id = module.vpc.vpc_id - subnet_ids = module.vpc.private_subnet_ids - node_groups = var.node_groups + cluster_name = var.cluster_name + cluster_version = var.cluster_version + vpc_id = module.vpc.vpc_id + subnet_ids = module.vpc.private_subnet_ids + node_groups = var.node_groups - endpoint_private_access = true - endpoint_public_access = true - public_access_cidrs = var.public_access_cidrs + endpoint_private_access = true + endpoint_public_access = true + public_access_cidrs = var.public_access_cidrs depends_on = [module.vpc] } diff --git a/astroshop-terraform/terraform.tfvars b/astroshop-terraform/terraform.tfvars new file mode 100644 index 0000000..a68abe8 --- /dev/null +++ b/astroshop-terraform/terraform.tfvars @@ -0,0 +1,29 @@ +region = "ap-south-1" +cluster_name = "astroshop-eks-cluster" +cluster_version = "1.32" +vpc_cidr = "10.0.0.0/16" +availability_zones = ["ap-south-1a", "ap-south-1b", "ap-south-1c"] +private_subnet_cidrs = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] +public_subnet_cidrs = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] +public_access_cidrs = ["0.0.0.0/0"] # This should be Changed to client IP range! + +node_groups = { + general = { + instance_types = ["m7i-flex.large"] + capacity_type = "ON_DEMAND" + scaling_config = { + desired_size = 2 + max_size = 3 + min_size = 1 + } + } + # spot = { + # instance_types = ["m7i-flex.large"] + # capacity_type = "SPOT" + # scaling_config = { + # desired_size = 1 + # max_size = 3 + # min_size = 0 + # } + # } +} diff --git a/astroshop-terraform/variables.tf b/astroshop-terraform/variables.tf index 54bca93..35faef8 100644 --- a/astroshop-terraform/variables.tf +++ b/astroshop-terraform/variables.tf @@ -42,8 +42,8 @@ variable "cluster_version" { variable "public_access_cidrs" { description = "List of CIDR blocks that can access the public API endpoint" - type = list(string) - default = [] + type = list(string) + default = [] } variable "node_groups" { |
