1 Answer
- Newest
- Most votes
- Most comments
0
Hello there,
Looking into your code, a few things I noticed:
-
For Fagete Service, there is no need to define host port, since the host port and the container port should be the same.
-
You should use
taskImageOptions
tp define container port
Here is an example code snippet:
const service = new EcsPatterns.ApplicationLoadBalancedFargateService(this, 'demoService', {
cluster: cluster,
publicLoadBalancer: true,
certificate,
memoryLimitMiB: 2048,
cpu: 512,
desiredCount: 2,
serviceName: 'demoService',
taskImageOptions: {
containerName: 'web',
containerPort: 8080, // Your container or app port
executionRole,
taskRole,
environment: {
...
},
image: ecs.ContainerImage.fromEcrRepository(repository),
logDriver: new ecs.AwsLogDriver({
logGroup,
streamPrefix: props.serviceName,
}),
},
})
service.targetGroup.configureHealthCheck({
path: '/v1/healthcheck',
})
With above example, ApplicationLoadBalancedFargateService
configures health check against container port 8080, but with a different path /v1/healthcheck
as per overriding.
Relevant content
- asked 3 years ago
- asked 2 years ago
- Accepted Answerasked 2 years ago
- asked 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago