Skip to content

Instantly share code, notes, and snippets.

@jeznag
Created October 16, 2020 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeznag/4c1972d919e34f939bd44830fcb9bbd8 to your computer and use it in GitHub Desktop.
Save jeznag/4c1972d919e34f939bd44830fcb9bbd8 to your computer and use it in GitHub Desktop.
ApplicationLoadBalancedFargateService with two SSL certs
const grafanaService = new ecs_patterns.ApplicationLoadBalancedFargateService(this, 'Grafana', {
cluster: this.props.ecsCluster,
taskDefinition: taskdef,
domainZone: this.props.hostedZone,
domainName: this.grafanaDns,
publicLoadBalancer: true
})
const sslListener = grafanaService.loadBalancer.addListener('SSL', {
port: 443,
certificates: [this.props.certificateHarvestSubdomain, this.props.certificateRootSubdomain],
protocol: ApplicationProtocol.HTTPS
})
sslListener.addTargets('grafanaTarget', {
targets: [grafanaService.service],
port: 80,
protocol: ApplicationProtocol.HTTP,
healthCheck: {
path: '/login',
interval: cdk.Duration.minutes(1)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment