Skip to content

Commit

Permalink
Deployments sync 20230608 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernstein authored Jun 8, 2023
1 parent 6af8b74 commit bd4bbf8
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 22 deletions.
37 changes: 21 additions & 16 deletions duracloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,13 @@ resource "aws_elastic_beanstalk_configuration_template" "config" {
name = "LoadBalancerType"
value = "application"
}
}

setting {
namespace = "aws:elasticbeanstalk:environment:process:default"
name = "StickinessEnabled"
value = "true"
}
}

resource "aws_elastic_beanstalk_environment" "duracloud" {
name = "${var.stack_name}-core"
Expand Down Expand Up @@ -247,22 +252,22 @@ resource "aws_elastic_beanstalk_environment" "duracloud" {
value = var.duracloud_instance_class
}

}
setting {
namespace = "aws:autoscaling:asg"
name = "MinSize"
value = var.minimum_instance_count
}

resource "aws_alb_target_group" "duracloud" {
name = "${var.stack_name}-duracloud"
target_type = "alb"
port = 80
protocol = "TCP"
vpc_id = data.aws_vpc.duracloud.id
stickiness {
type = "app_cookie"
cookie_name = "jsessionid"
setting {
namespace = "aws:autoscaling:asg"
name = "MaxSize"
value = var.maximum_instance_count
}
}

resource "aws_alb_target_group_attachment" "duracloud" {
target_group_arn = aws_alb_target_group.duracloud.arn
target_id = aws_elastic_beanstalk_environment.duracloud.load_balancers[0]
port = 80
setting {
namespace = "aws:elasticbeanstalk:environment:process:default"
name = "HealthCheckPath"
value = "/duradmin/login"
}
}

10 changes: 10 additions & 0 deletions duracloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ variable "ec2_keypair" {
variable "stack_name" {
description = "The name of the duracloud stack."
}

variable "minimum_instance_count" {
description = "The minimum number of instances to run"
default = 2
}

variable "maximum_instance_count" {
description = "The minimum number of instances to run"
default = 6
}
36 changes: 30 additions & 6 deletions management-console/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ resource "aws_elastic_beanstalk_application" "mc" {
max_count = 128
delete_source_from_s3 = true
}

tags = {
Name = "${var.stack_name}-eb-mc-application"
}
}

resource "aws_elastic_beanstalk_application_version" "default" {
Expand Down Expand Up @@ -215,15 +211,27 @@ resource "aws_elastic_beanstalk_configuration_template" "config" {
name = "LoadBalancerType"
value = "application"
}
}

setting {
namespace = "aws:elasticbeanstalk:environment:process:default"
name = "HealthCheckPath"
value = "/login"
}

setting {
namespace = "aws:elasticbeanstalk:environment:process:default"
name = "StickinessEnabled"
value = "true"
}
}

resource "aws_elastic_beanstalk_environment" "mc" {
name = "${var.stack_name}-management-console"
application = aws_elastic_beanstalk_application.mc.name
template_name = aws_elastic_beanstalk_configuration_template.config.name
version_label = var.mc_war


setting {
namespace = "aws:elasticbeanstalk:container:tomcat:jvmoptions"
name = "JVM Options"
Expand All @@ -242,11 +250,27 @@ resource "aws_elastic_beanstalk_environment" "mc" {
value = "HTTPS"
}


setting {
namespace = "aws:autoscaling:launchconfiguration"
name = "InstanceType"
value = var.mc_instance_class
}

setting {
namespace = "aws:elasticbeanstalk:application"
name = "Application Healthcheck URL"
value = "/login"
}

setting {
namespace = "aws:autoscaling:asg"
name = "MinSize"
value = var.minimum_instance_count
}

setting {
namespace = "aws:autoscaling:asg"
name = "MaxSize"
value = var.maximum_instance_count
}
}
9 changes: 9 additions & 0 deletions management-console/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ variable "stack_name" {
description = "The name of the duracloud stack."
}

variable "minimum_instance_count" {
description = "The minimum number of instances to run"
default = 2
}

variable "maximum_instance_count" {
description = "The minimum number of instances to run"
default = 4
}

0 comments on commit bd4bbf8

Please sign in to comment.