fix(uti): Terraform settings 53/36153/2
authorPeter Mikus <pmikus@cisco.com>
Tue, 17 May 2022 10:32:47 +0000 (12:32 +0200)
committerPeter Mikus <pmikus@cisco.com>
Tue, 17 May 2022 10:46:39 +0000 (10:46 +0000)
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: Ica539512f3129391551938541d00d9e9d1560af3

fdio.infra.terraform/terraform-aws-elastic-beanstalk-environment/main.tf
fdio.infra.terraform/terraform-aws-elastic-beanstalk-environment/variables.tf
fdio.infra.terraform/terraform-aws-fdio-csit-dash-env/main.tf

index 7fbf50c..fd570ab 100644 (file)
@@ -422,6 +422,39 @@ resource "aws_elastic_beanstalk_environment" "environment" {
     value     = aws_iam_instance_profile.ec2_iam_instance_profile.name
   }
 
     value     = aws_iam_instance_profile.ec2_iam_instance_profile.name
   }
 
+  # aws:autoscaling:updatepolicy:rollingupdate
+  setting {
+    namespace = "aws:autoscaling:updatepolicy:rollingupdate"
+    name      = "RollingUpdateEnabled"
+    value     = var.autoscaling_updatepolicy_rolling_update_enabled
+  }
+
+  setting {
+    namespace = "aws:autoscaling:updatepolicy:rollingupdate"
+    name      = "RollingUpdateType"
+    value     = var.autoscaling_updatepolicy_rolling_update_type
+  }
+
+  setting {
+    namespace = "aws:autoscaling:updatepolicy:rollingupdate"
+    name      = "MinInstancesInService"
+    value     = var.autoscaling_updatepolicy_min_instance_in_service
+  }
+
+  # aws:elasticbeanstalk:command
+  setting {
+    namespace = "aws:elasticbeanstalk:command"
+    name      = "DeploymentPolicy"
+    value     = var.command_deployment_policy
+  }
+
+  # aws:autoscaling:updatepolicy:rollingupdate
+  setting {
+    namespace = "aws:autoscaling:updatepolicy:rollingupdate"
+    name      = "MaxBatchSize"
+    value     = var.updatepolicy_max_batch_size
+  }
+
   # aws:elasticbeanstalk:healthreporting:system
   setting {
     namespace = "aws:elasticbeanstalk:healthreporting:system"
   # aws:elasticbeanstalk:healthreporting:system
   setting {
     namespace = "aws:elasticbeanstalk:healthreporting:system"
index c2a1ea3..b0c4189 100644 (file)
@@ -163,6 +163,39 @@ variable "environment_process_default_unhealthy_threshold_count" {
   default     = 3
 }
 
   default     = 3
 }
 
+# aws:autoscaling:updatepolicy:rollingupdate
+variable "autoscaling_updatepolicy_rolling_update_enabled" {
+  description = "Whether to enable rolling update."
+  type        = bool
+  default     = true
+}
+
+variable "autoscaling_updatepolicy_rolling_update_type" {
+  description = "`Health` or `Immutable`. Set it to `Immutable` to apply the configuration change to a fresh group of instances."
+  type        = string
+  default     = "Immutable"
+}
+
+variable "autoscaling_updatepolicy_min_instance_in_service" {
+  description = "Minimum number of instances in service during update."
+  type        = number
+  default     = 1
+}
+
+# aws:elasticbeanstalk:command
+variable "command_deployment_policy" {
+  description = "Use the DeploymentPolicy option to set the deployment type. The following values are supported: `AllAtOnce`, `Rolling`, `RollingWithAdditionalBatch`, `Immutable`, `TrafficSplitting`."
+  type        = string
+  default     = "Rolling"
+}
+
+# aws:autoscaling:updatepolicy:rollingupdate
+variable "updatepolicy_max_batch_size" {
+  description = "Maximum number of instances to update at once."
+  type        = number
+  default     = 1
+}
+
 # aws:elasticbeanstalk:healthreporting:system
 variable "healthreporting_system_type" {
   description = "Whether to enable enhanced health reporting for this environment"
 # aws:elasticbeanstalk:healthreporting:system
 variable "healthreporting_system_type" {
   description = "Whether to enable enhanced health reporting for this environment"
index 3e70b4d..65dc59f 100644 (file)
@@ -34,9 +34,9 @@ module "elastic_beanstalk_environment" {
   environment_application            = module.elastic_beanstalk_application.application_name
   environment_description            = module.elastic_beanstalk_application.application_description
   environment_name                   = "fdio-csit-dash-env"
   environment_application            = module.elastic_beanstalk_application.application_name
   environment_description            = module.elastic_beanstalk_application.application_description
   environment_name                   = "fdio-csit-dash-env"
-  environment_solution_stack_name    = "64bit Amazon Linux 2 v3.3.12 running Python 3.8"
+  environment_solution_stack_name    = "64bit Amazon Linux 2 v3.3.13 running Python 3.8"
   environment_tier                   = "WebServer"
   environment_tier                   = "WebServer"
-  environment_wait_for_ready_timeout = "20m"
+  environment_wait_for_ready_timeout = "25m"
   environment_version_label          = ""
 
   # aws:ec2:instances
   environment_version_label          = ""
 
   # aws:ec2:instances
@@ -58,6 +58,17 @@ module "elastic_beanstalk_environment" {
   environment_process_default_port                      = 5000
   environment_process_default_unhealthy_threshold_count = 3
 
   environment_process_default_port                      = 5000
   environment_process_default_unhealthy_threshold_count = 3
 
+  # aws:autoscaling:updatepolicy:rollingupdate
+  autoscaling_updatepolicy_rolling_update_enabled  = true
+  autoscaling_updatepolicy_rolling_update_type     = "Immutable"
+  autoscaling_updatepolicy_min_instance_in_service = 1
+
+  # aws:elasticbeanstalk:command
+  command_deployment_policy = "Rolling"
+
+  # aws:autoscaling:updatepolicy:rollingupdate
+  updatepolicy_max_batch_size = 1
+
   # aws:elasticbeanstalk:healthreporting:system
   healthreporting_system_type = "enhanced"
 
   # aws:elasticbeanstalk:healthreporting:system
   healthreporting_system_type = "enhanced"