summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--astroshop-terraform/backend.tf8
-rw-r--r--astroshop-terraform/main.tf16
-rw-r--r--astroshop-terraform/terraform.tfvars29
-rw-r--r--astroshop-terraform/variables.tf4
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" {