Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions scripts/ecs-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ set -e
SCRIPT_DIR=$(dirname "$0")
export ECR_URI="${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${ECR_REPO}:${IMAGE_TAG}"

TASK_DEF_ARN=$(aws ecs describe-services \
--cluster "$CLUSTER" --services "$SERVICE" \
--query 'services[0].taskDefinition' --output text)

aws ecs describe-task-definition --task-definition "$TASK_DEF_ARN" \
# Use the latest family revision (includes structural changes from Terraform)
# rather than the revision currently running on the service.
aws ecs describe-task-definition --task-definition "$SERVICE" \
--query 'taskDefinition' > task-def.json

sh "$SCRIPT_DIR/update-task-def.sh" task-def.json task-def-new.json
Expand Down
1 change: 1 addition & 0 deletions scripts/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"route53_zone_id": "ref:platform.route53_zone_id",
"alb_dns_name": "ref:platform.alb_dns_name",
"alb_zone_id": "ref:platform.alb_zone_id",
"deregistration_delay": "yaml:routing.deregistration_delay|default:30",
},
"rename": "routing",
"output_map": {
Expand Down
16 changes: 9 additions & 7 deletions terraform/modules/service-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
################################################################################

resource "aws_lb_target_group" "this" {
name = "${var.project}-${var.name}"
port = var.port
protocol = "HTTP"
vpc_id = var.vpc_id
target_type = "ip"
name = "${var.project}-${var.name}"
port = var.port
protocol = "HTTP"
vpc_id = var.vpc_id
target_type = "ip"
deregistration_delay = var.deregistration_delay
load_balancing_algorithm_type = "round_robin"

health_check {
path = var.health_check_path
protocol = "HTTP"
healthy_threshold = 2
unhealthy_threshold = 3
unhealthy_threshold = 2
timeout = 5
interval = 30
interval = 10
matcher = var.health_check_matcher
}

Expand Down
6 changes: 6 additions & 0 deletions terraform/modules/service-routing/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ variable "alb_zone_id" {
description = "ALB hosted zone ID for the Route53 alias target"
type = string
}

variable "deregistration_delay" {
description = "Seconds to wait for in-flight requests before deregistering targets"
type = number
default = 30
}
Loading