Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Connection Draining for AWS Load Balancer v2 in CloudFormation

This blog post (here specifically) details how to configure connection draining for a 'classic' version 1 load balancer using the AWS::ElasticLoadBalancing::LoadBalancer type, like so:

"ElasticLoadBalancer": {
  "Type": "AWS::ElasticLoadBalancing::LoadBalancer",
  "Properties": {
    "ConnectionDrainingPolicy": {
      "Enabled": "true",
      "Timeout": "300"
    },
    ...
  }
}

How can I do this using the version 2 load balancer with type AWS::ElasticLoadBalancingV2::LoadBalancer?

My best guess from the documentation is that I should use LoadBalancerAttributes, but I can't find anything related to connection draining in the list of attributes here.

like image 205
davnicwil Avatar asked Mar 13 '18 13:03

davnicwil


1 Answers

In Application Load Balancer(ELB V2 ) it in configured using TargetGroups and TargetGroupAttributes and is called Deregistration delay, not Connection draining.

deregistration_delay.timeout_seconds - The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

   TargetGroup:
      Type: AWS::ElasticLoadBalancingV2::TargetGroup
      Properties:
        TargetGroupAttributes:
        - Key: deregistration_delay.timeout_seconds
          Value: '20'
like image 81
Sudharsan Sivasankaran Avatar answered Nov 08 '22 11:11

Sudharsan Sivasankaran