Skip to content

Commit

Permalink
enable container restart policy for beta (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhelezovartem authored Oct 28, 2024
1 parent 4e55b99 commit 03c5450
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
2 changes: 2 additions & 0 deletions deployment/terraform/274425519734-eu-central-1.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
env = "prod"

container_restart_policy_enabled = false

# Allow to replicate app docker images from this account
ecr_replication_origin = "244531986313"
24 changes: 13 additions & 11 deletions deployment/terraform/deployment.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
module "ecs-service" {
source = "s3::https://s3-eu-central-1.amazonaws.com/terraform-modules-9d7e951c290ec5bbe6506e0ddb064808764bc636/terraform-modules.zip//ecs-service/v4"
service_name = var.service_name
TAGGED_IMAGE = var.TAGGED_IMAGE
enable_execute_command = "true"
app_port = var.app_port
cpu_limit = var.cpu_limit
mem_reservation = var.mem_reservation
mem_limit = var.mem_limit
app_env_vars = local.app_env_vars
ecs_wait_for_steady_state = true
tags = module.tags.result
source = "s3::https://s3-eu-central-1.amazonaws.com/terraform-modules-9d7e951c290ec5bbe6506e0ddb064808764bc636/terraform-modules.zip//ecs-service/v5"
service_name = var.service_name
TAGGED_IMAGE = var.TAGGED_IMAGE
enable_execute_command = "true"
app_port = var.app_port
cpu_limit = var.cpu_limit
mem_reservation = var.mem_reservation
mem_limit = var.mem_limit
app_env_vars = local.app_env_vars
ecs_wait_for_steady_state = true
ecs_service_update_timeout = "10m"
container_restart_policy_enabled = var.container_restart_policy_enabled
tags = module.tags.result
}
6 changes: 6 additions & 0 deletions deployment/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ variable "mem_reservation" {
default = 64
}

variable "container_restart_policy_enabled" {
description = "Whether to enable restart policy for the container."
type = bool
default = true
}

variable "TAGGED_IMAGE" {
type = string
}
Expand Down
2 changes: 1 addition & 1 deletion deployment/terraform/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.25.0"
version = "~> 5.73.0"
}
random = {
source = "hashicorp/random"
Expand Down

0 comments on commit 03c5450

Please sign in to comment.