Skip to content
Merged
2 changes: 2 additions & 0 deletions ansible/roles/deploy-ecs-proxies/templates/terraform/alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ resource "aws_alb_target_group" "service" {
protocol = local.exposed_service.lb_protocol
vpc_id = data.terraform_remote_state.pre-reqs.outputs.vpc_id
target_type = "ip"
load_balancing_algorithm_type = "least_outstanding_requests"
deregistration_delay = var.deregistration_delay

health_check {
matcher = local.exposed_service.health_check.matcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ resource "aws_ecs_service" "service" {
launch_type = "FARGATE"

deployment_maximum_percent = 200
deployment_minimum_healthy_percent = 0
deployment_minimum_healthy_percent = 100
force_new_deployment = true

network_configuration {
security_groups = data.terraform_remote_state.pre-reqs.outputs.security_groups
subnets = data.terraform_remote_state.pre-reqs.outputs.subnet_ids
}

health_check_grace_period_seconds = 45
health_check_grace_period_seconds = {{ health_check_grace_period_seconds }}

load_balancer {
target_group_arn = aws_alb_target_group.service.arn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ variable "autoscaling_scale_in_cooldown" {

variable "autoscaling_scale_out_cooldown" {
type = number
}

variable "deregistration_delay" {
type = number
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ autoscaling_enabled = {{ autoscaling_policy.enabled | ternary('true',
autoscaling_service_metric = "{{ autoscaling_policy.service_metric }}"
autoscaling_target_value = {{ autoscaling_policy.target_value }}
autoscaling_scale_in_cooldown = {{ autoscaling_policy.scale_in_cooldown }}
autoscaling_scale_out_cooldown = {{ autoscaling_policy.scale_out_cooldown }}
autoscaling_scale_out_cooldown = {{ autoscaling_policy.scale_out_cooldown }}
deregistration_delay = {{ deregistration_delay }}
4 changes: 3 additions & 1 deletion ansible/roles/deploy-ecs-proxies/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ service_cpu: "{{ docker_service_cpu | default(256) }}"
service_memory: "{{ docker_service_memory | default(512) }}"
do_not_terraform: "{{ lookup('env','do_not_terraform') }}"
default_desired_capacity: "{{ 2 if apigee_environment in ('prod', 'ref') else 1 }}"
autoscaling_policy: "{{ docker_service_autoscaling | default({}) | as_ecs_autoscaling }}"
autoscaling_policy: "{{ docker_service_autoscaling | default({}) | as_ecs_autoscaling }}"
health_check_grace_period_seconds: "{{ docker_service_health_check_grace_period_seconds | default(60) }}"
deregistration_delay: "{{ docker_service_dereg_delay | default(120) }}"
9 changes: 3 additions & 6 deletions azure/common/apigee-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ extends:
- ${{ if and(eq(apigee_deployment.environment, 'prod'), parameters.prod_requires_approval) }}:
- environment: manual-approval
stage_name: manual_approval
depends_on:
- internal_qa
- internal_qa_sandbox
depends_on: []
${{ each var in parameters._scoped_pipeline_vars }}:
${{ var }}: ${{ parameters[var] }}
- ${{ each apigee_deployment in parameters.apigee_deployments }}:
Expand All @@ -179,12 +177,11 @@ extends:
${{ if not(apigee_deployment[var]) }}:
${{ var }}: ${{ parameters[var] }}
${{ if not(apigee_deployment.depends_on) }}:
${{ if startsWith(apigee_deployment.environment, 'internal-') }}:
${{ if or(startsWith(apigee_deployment.environment, 'internal-'), eq(apigee_deployment.environment, 'manual-approval')) }}:
depends_on: []
${{ if not(startsWith(apigee_deployment.environment, 'internal-')) }}:
${{ if and(not(startsWith(apigee_deployment.environment, 'internal-')), ne(apigee_deployment.environment, 'manual-approval')) }}:
depends_on:
- internal_qa
- internal_qa_sandbox
- ${{ if and(eq(apigee_deployment.environment, 'prod'), parameters.prod_requires_approval) }}:
- manual_approval
${{ if apigee_deployment.depends_on }}:
Expand Down