Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const greetingService = new ecs.Ec2Service(this, 'greeting-service', {
cluster: cluster,
desiredCount: 2,
taskDefinition: greetingTaskDefinition
});
// Internal load balancer for the backend services
const internalLB = new elbv2.ApplicationLoadBalancer(this, 'internal', {
vpc: vpc,
internetFacing: false
});
const internalListener = internalLB.addListener('PublicListener', { port: 80, open: true });
internalListener.addTargetGroups('default', {
targetGroups: [new elbv2.ApplicationTargetGroup(this, 'default', {
vpc: vpc,
protocol: 'HTTP',
port: 80
})]
});
internalListener.addTargets('name', {
port: 80,
pathPattern: '/name*',
priority: 1,
targets: [nameService]
});
internalListener.addTargets('greeting', {
port: 80,
pathPattern: '/greeting*',