title: How to deploy AWS loadbalancer listeners via AWS CDK that redirect and forward to ECS container
body: <p>I'm trying to deploy a listener on a loadbalancer with the following configuration (manually modified and tested, following CDK deploy):</p>
  <p><a href="https://i.stack.imgur.com/tCSEV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tCSEV.png" alt="Listner Configuration" /></a></p>
  <p>The following code adds the listener, but doesn't update listener to redirect port 80 to 443 (https) and the HTTPs:443 listener ID is trying to connect with ECS over HTTPS rather than HTTP.</p>
  <pre><code>    loadbalancer = cdk.aws_elasticloadbalancingv2.ApplicationLoadBalancer(
          self, 'loadbalancer',
          vpc=p_vpc,
          internet_facing=True,
          load_balancer_name='ppal-alb'
      )
  
      loadbalancer_listener = cdk.aws_elasticloadbalancingv2.ApplicationListener(
          self, 'loadbalancer-listener',
          open=True,
          port=443,
          certificates=[p_certificate],
          load_balancer=loadbalancer
      )
  
      loadbalancer_listener.add_action(
          'redirect-action',
          action=cdk.aws_elasticloadbalancingv2.ListenerAction
          .redirect(
              port='443',
              protocol='HTTPS',
              permanent=True)
      )
  
      target_group_config = cdk.aws_elasticloadbalancingv2.ApplicationTargetGroup(
          self, 'target-group',
          port=443,
          protocol=cdk.aws_elasticloadbalancingv2.ApplicationProtocol.HTTPS,
          target_type=cdk.aws_elasticloadbalancingv2.TargetType.IP,
          vpc=p_vpc
      )
  
      loadbalancer_listener.add_target_groups(
          'loadbalancer_listener_target_group',
          target_groups=[target_group_config]
      )
  </code></pre>