Skip to content

Commit d5d4909

Browse files
DT-560 updates k8s and adds vpc cidr input (#30)
* addedd vpc_cidr as variable * pass cidr var to module * make module use var and update k8s * add vpc toggles * optional backend state file * fix var default
1 parent bffa8cc commit d5d4909

File tree

6 files changed

+31
-3
lines changed

6 files changed

+31
-3
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module "comet_vpc" {
2020
environment = var.environment
2121
common_tags = local.all_tags
2222
region = var.region
23+
vpc_cidr = var.vpc_cidr
2324

2425
eks_enabled = var.enable_eks
2526
single_nat_gateway = var.single_nat_gateway

modules/comet_vpc/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ data "aws_availability_zones" "available" {}
22

33
locals {
44
resource_name = "comet-${var.environment}"
5-
vpc_cidr = "10.0.0.0/16"
5+
vpc_cidr = var.vpc_cidr
66
azs = slice(data.aws_availability_zones.available.names, 0, 3)
77
}
88

modules/comet_vpc/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ variable "region" {
2323
description = "AWS region to provision resources in"
2424
type = string
2525
}
26+
27+
variable "vpc_cidr" {
28+
description = "CIDR block for the VPC"
29+
type = string
30+
default = "10.0.0.0/16"
31+
}

statebackend.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Uncomment to use S3 backend for remote state
2+
# terraform {
3+
# backend "s3" {
4+
# bucket = "your-terraform-state-bucket"
5+
# key = "path/to/terraform.tfstate"
6+
# region = "us-east-1"
7+
# dynamodb_table = "your-lock-table" # Optional: for state locking
8+
# encrypt = true
9+
# }
10+
# }

terraform.tfvars

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Deployment identifier
1313
## Places an Environment tag on all resources created by this module
14-
environment_tag = "deployment-development"
14+
# environment_tag = "deployment-development"
1515

1616
########################
1717
#### Module toggles ####
@@ -60,6 +60,10 @@ comet_private_subnets = ["subnet-012345abcdefghijkl", "subnet-012345abcdefghijkl
6060
#######################
6161
## Required module inputs listed below. Any desired overrides from the defaults in variables.tf can also be added here
6262

63+
#### comet_vpc ####
64+
# # If setting enable_vpc, you may specify the CIDR block for the VPC below
65+
# vpc_cidr = "your.cidr.block/16"
66+
6367
#### comet_ec2 ####
6468
#
6569

variables.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ variable "comet_public_subnets" {
8383
#### Module inputs ####
8484
#######################
8585

86+
#### comet_vpc ####
87+
variable "vpc_cidr" {
88+
description = "CIDR block for the VPC to provision"
89+
type = string
90+
default = "10.0.0.0/16"
91+
}
92+
8693
#### comet_ec2 ####
8794
variable "comet_ec2_ami_type" {
8895
type = string
@@ -147,7 +154,7 @@ variable "eks_cluster_name" {
147154
variable "eks_cluster_version" {
148155
description = "Kubernetes version of the EKS cluster"
149156
type = string
150-
default = "1.27"
157+
default = "1.32"
151158
}
152159

153160
variable "eks_mng_name" {

0 commit comments

Comments
 (0)