Skip to content

Instantly share code, notes, and snippets.

@vivekbeas
Created April 29, 2020 00:18
Show Gist options
  • Save vivekbeas/b79f4e49df5dd103e41bb648ebfa6029 to your computer and use it in GitHub Desktop.
Save vivekbeas/b79f4e49df5dd103e41bb648ebfa6029 to your computer and use it in GitHub Desktop.
AWS Elastic beanstalk application configuration to HTTP redirection to HTTPS rule on the load balancer
Resources:
PublicLoadBalancerHttpRedirectListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- RedirectConfig:
Host: "#{host}"
Path: "/#{path}"
Port: 443
Protocol: "HTTPS"
Query: "#{query}"
StatusCode: HTTP_301
Type: redirect
LoadBalancerArn:
Ref: AWSEBV2LoadBalancer
Port: 80
Protocol: HTTP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment