Skip to main content

AWS CDK Construct Library to help create redirects on AWS application load balancers

Project description

AWS ELBv2 Redirection CDK Construct Library

This library makes it easy to creation redirection rules on Application Load Balancers.

Usage

Base redirection construct (Typescript)

// create a vpc
const vpc = new ec2.Vpc(stack, 'vpc');

// create an alb in that vpc
const alb = new elbv2.ApplicationLoadBalancer(stack, 'alb', {
  internetFacing: true,
  vpc,
});

// create a redirect from 8080 to 8443
new Redirect(stack, 'redirect', {
  alb,
  sourcePort: 8080,
  sourceProtocol: elbv2.ApplicationProtocol.HTTP,
  targetPort: 8443,
  targetProtocol: elbv2.ApplicationProtocol.HTTPS,
});

Using the pre-build HTTP to HTTPS construct (Typescript)

// create a vpc
const vpc = new ec2.Vpc(stack, 'vpc');

// create an alb in that vpc
const alb = new elbv2.ApplicationLoadBalancer(stack, 'alb', {
  internetFacing: true,
  vpc,
});

// use the pre-built construct for HTTP to HTTPS
new RedirectHttpHttps(stack, 'redirectHttpHttps', {
  alb,
});

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

renovosolutions.aws-cdk-aws-ipam-0.0.163.tar.gz (27.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page