Skip to content

Commit f069d20

Browse files
committed
Remove external_dependencies configuration, cleanup module and toggle var naming, cut tfvars files to one
1 parent 935ce63 commit f069d20

24 files changed

+20
-326
lines changed

ec2-ext-dep.tfplan

-30.6 KB
Binary file not shown.

ec2_standalone.tvfars

Whitespace-only changes.

eks_standalone.tfvars

Lines changed: 0 additions & 7 deletions
This file was deleted.

external_dependencies_only.tfvars

Lines changed: 0 additions & 13 deletions
This file was deleted.

main.tf

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ data "aws_availability_zones" "available" {}
22

33
/*
44
data "aws_eks_cluster_auth" "this" {
5-
name = module.eks_deployment[0].cluster_name
5+
name = module.comet_eks[0].cluster_name
66
}
77
*/
88

@@ -43,15 +43,15 @@ module "vpc" {
4343
default_security_group_tags = { Name = "${local.resource_name}-default" }
4444

4545
# if EKS deployment, set subnet tags for AWS Load Balancer Controller auto-discovery
46-
public_subnet_tags = var.enable_eks_deployment ? {"kubernetes.io/role/elb" = 1} : null
47-
private_subnet_tags = var.enable_eks_deployment ? {"kubernetes.io/role/internal-elb" = 1} : null
46+
public_subnet_tags = var.enable_eks ? {"kubernetes.io/role/elb" = 1} : null
47+
private_subnet_tags = var.enable_eks ? {"kubernetes.io/role/internal-elb" = 1} : null
4848

4949
tags = local.tags
5050
}
5151

52-
module "ec2_deployment" {
53-
source = "./modules/ec2_deployment"
54-
count = var.enable_ec2_deployment ? 1 : 0
52+
module "comet_ec2" {
53+
source = "./modules/comet_ec2"
54+
count = var.enable_comet_ec2 ? 1 : 0
5555

5656
vpc_id = module.vpc.vpc_id
5757
allinone_ami = "ami-05842f1afbf311a43"
@@ -60,41 +60,26 @@ module "ec2_deployment" {
6060
comet_ml_s3_bucket = var.s3_bucket_name
6161
}
6262

63-
module "eks_deployment" {
64-
source = "./modules/eks_deployment"
65-
count = var.enable_eks_deployment ? 1 : 0
63+
module "comet_eks" {
64+
source = "./modules/comet_eks"
65+
count = var.enable_eks ? 1 : 0
6666

6767
vpc_id = module.vpc.vpc_id
6868
vpc_private_subnets = module.vpc.private_subnets
6969
cluster_name = var.eks_cluster_name
7070
cluster_version = var.eks_cluster_version
7171
}
7272

73-
/*
74-
module "external_dependencies" {
75-
source = "./modules/external_dependencies"
76-
count = var.enable_external_dependencies ? 1 : 0
77-
78-
availability_zones = local.azs
79-
vpc_id = module.vpc.vpc_id
80-
vpc_private_subnets = module.vpc.private_subnets
81-
82-
comet_ml_s3_bucket = var.s3_bucket_name
83-
84-
elasticache_rds_allowfrom_sg = module.ec2_deployment[0].allinone_sg_id
85-
}
86-
*/
87-
8873
module "comet_elasticache" {
8974
source = "./modules/comet_elasticache"
9075
count = var.enable_elasticache ? 1 : 0
9176

9277
vpc_id = module.vpc.vpc_id
9378
vpc_private_subnets = module.vpc.private_subnets
9479

95-
# need to get SGs from ec2_deployment or eks_deployment, depending on which is used
96-
# index is used on the ec2_deployment becuase of the count usage in the toggle: "After the count apply the resource becomes a group, so later in the reference use 0-index of the group"
97-
elasticache_rds_allowfrom_sg = module.ec2_deployment[0].allinone_sg_id
80+
# need to get SGs from comet_ec2 or comet_eks, depending on which is used
81+
# index is used on the comet_ec2 becuase of the count usage in the toggle: "After the count apply the resource becomes a group, so later in the reference use 0-index of the group"
82+
elasticache_rds_allowfrom_sg = module.comet_ec2[0].allinone_sg_id
9883
}
9984

10085
module "comet_rds" {
@@ -105,9 +90,9 @@ module "comet_rds" {
10590
vpc_id = module.vpc.vpc_id
10691
vpc_private_subnets = module.vpc.private_subnets
10792

108-
# need to get SGs from ec2_deployment or eks_deployment, depending on which is used
109-
# index is used on the ec2_deployment becuase of the count usage in the toggle: "After the count apply the resource becomes a group, so later in the reference use 0-index of the group"
110-
elasticache_rds_allowfrom_sg = module.ec2_deployment[0].allinone_sg_id
93+
# need to get SGs from comet_ec2 or comet_eks, depending on which is used
94+
# index is used on the comet_ec2 becuase of the count usage in the toggle: "After the count apply the resource becomes a group, so later in the reference use 0-index of the group"
95+
elasticache_rds_allowfrom_sg = module.comet_ec2[0].allinone_sg_id
11196

11297
}
11398

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)