Setting Minimum Protocol Version for HttpsRedirect in CDK

To change the minimum protocol version when using Https redirect route 53 patterns you must first find the RedirectDistribution and then in that the defaultChild then you can add a poroperty override for the DistributionConfig.ViewerCertificate.MinimumProtocolVersion property, setting the tls version. In my case I used TLSv1.2_2021 find all the versions here -> https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html

const redirect = new aws_route53_patterns.HttpsRedirect(this, 'Redirect', {
            zone,
            recordNames: [`www.${config.zoneName}`],
            targetDomain: config.zoneName,
        });

const override = redirect.node.tryFindChild('RedirectDistribution') as cf.CfnDistribution;
const cfnDistribution = override.node.defaultChild as cf.CfnDistribution;
        cfnDistribution.addPropertyOverride('DistributionConfig.ViewerCertificate.MinimumProtocolVersion', 'TLSv1.2_2021');



Categories: AWS

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: