Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.listener = this.loadBalancer.addListener('PublicListener', {
protocol,
open: true
});
this.targetGroup = this.listener.addTargets('ECS', targetProps);
if (protocol === ApplicationProtocol.HTTPS) {
if (typeof props.domainName === 'undefined' || typeof props.domainZone === 'undefined') {
throw new Error('A domain name and zone is required when using the HTTPS protocol');
}
if (props.certificate !== undefined) {
this.certificate = props.certificate;
} else {
this.certificate = new DnsValidatedCertificate(this, 'Certificate', {
domainName: props.domainName,
hostedZone: props.domainZone
});
}
}
if (this.certificate !== undefined) {
this.listener.addCertificateArns('Arns', [this.certificate.certificateArn]);
}
let domainName = this.loadBalancer.loadBalancerDnsName;
if (typeof props.domainName !== 'undefined') {
if (typeof props.domainZone === 'undefined') {
throw new Error('A Route53 hosted domain zone name is required to configure the specified domain name');
}
const record = new ARecord(this, "DNS", {