AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

HttpsRedirect

Allows creating a domainA -> domainB redirect using CloudFront and S3. You can specify multiple domains to be redirected.

Import

import { HttpsRedirect } from 'aws-cdk-lib/aws-route53-patterns';

Or use the module namespace:

import * as route53_patterns from 'aws-cdk-lib/aws-route53-patterns';
// route53_patterns.HttpsRedirect

Properties

Configuration passed to the constructor as HttpsRedirectProps.

targetDomainRequired
string

The redirect target fully qualified domain name (FQDN). An alias record will be created that points to your CloudFront distribution. Root domain or sub-domain can be supplied.

zoneRequired
IHostedZone

Hosted zone of the domain which will be used to create alias record(s) from domain names in the hosted zone to the target domain. The hosted zone must contain entries for the domain name(s) supplied through `recordNames` that will redirect to the target domain. Domain names in the hosted zone can include a specific domain (example.com) and its subdomains (acme.example.com, zenith.example.com).

certificateOptional
ICertificateRef

The AWS Certificate Manager (ACM) certificate that will be associated with the CloudFront distribution that will be created. If provided, the certificate must be stored in us-east-1 (N. Virginia)

Default: - A new certificate is created in us-east-1 (N. Virginia)

recordNamesOptional
string[]

The domain names that will redirect to `targetDomain`.

Default: - the domain name of the hosted zone

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL2 (Higher-level)
Moduleaws-route53-patterns
Properties4

External Links