magnificent-soccer-44287
09/27/2023, 7:27 AMconst service = new awsx.ecs.FargateService("service", {
containers: {
yourAppHere: {
healthCheck: {
interval: 15,
command: ["ps", "x", "|", "grep", "puma", "|", "grep", "0.0.0.0:3000"]
},
}
},
},
});
Given the above, does it run the following command inside the container?
ps x | grep | puma | grep | 0.0.0.0:3000
and pass if 0, fail if 1?dry-keyboard-94795
09/27/2023, 7:35 AMHEALTHCHECK
in docker.
Some useful docs for you for ECS specifics: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html
I think with pipes, you'll need to use the CMD-SHELL
varientmagnificent-soccer-44287
09/27/2023, 7:37 AMcommand: ["ps", "x", "|", "grep", "puma", "|", "grep", "0.0.0.0:3000"]
what I mean to use is:
command: ["CMD-SHELL", "ps", "x", "|", "grep", "puma", "|", "grep", "0.0.0.0:3000"]
?dry-keyboard-94795
09/27/2023, 7:37 AMmagnificent-soccer-44287
09/27/2023, 7:39 AMdry-keyboard-94795
09/27/2023, 7:41 AMmagnificent-soccer-44287
09/27/2023, 7:41 AMdry-keyboard-94795
09/27/2023, 7:42 AMmagnificent-soccer-44287
09/27/2023, 7:43 AMdry-keyboard-94795
09/27/2023, 7:45 AMmagnificent-soccer-44287
09/27/2023, 7:45 AMdry-keyboard-94795
09/27/2023, 7:46 AMmagnificent-soccer-44287
09/27/2023, 7:46 AMdry-keyboard-94795
09/27/2023, 7:48 AMmagnificent-soccer-44287
09/27/2023, 7:49 AMconst pmbMainLB = new awsx.lb.ApplicationLoadBalancer("pmb-main-alb", {
name: "pmb-main-web-traffic-alb",
defaultTargetGroup: {
port: 3000
},
listener: {
port: 80
},
});
^ That's my pulumi ALB config, with this in "awsx.ecs.FargateService":
portMappings: [{
targetGroup: pmbMainLB.defaultTargetGroup,
containerPort: 3000,
hostPort: 3000
}],
Will AWS terminate a fargate instance if its' corresponding target group fails?dry-keyboard-94795
09/27/2023, 7:51 AMmagnificent-soccer-44287
09/27/2023, 7:51 AM/**
* The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type `application`. Default: 60.
*/
idleTimeout?: pulumi.Input<number>;
in ApplicationLoadBalancerArgs, will trydry-keyboard-94795
09/27/2023, 7:54 AMmagnificent-soccer-44287
09/27/2023, 7:58 AMconst pmbMainLB = new awsx.lb.ApplicationLoadBalancer("name", {
defaultTargetGroup: {
healthCheck: {
enabled: false
}
});
^ found that, will trydry-keyboard-94795
09/27/2023, 8:15 AMmagnificent-soccer-44287
09/27/2023, 8:44 AMdry-keyboard-94795
09/27/2023, 8:59 AMmagnificent-soccer-44287
09/27/2023, 9:01 AMdry-keyboard-94795
09/27/2023, 9:03 AMmagnificent-soccer-44287
09/27/2023, 9:03 AMdry-keyboard-94795
09/27/2023, 9:07 AMmagnificent-soccer-44287
09/27/2023, 9:07 AMingress : [{
protocol : "tcp",
fromPort : 5432,
toPort : 5432,
cidrBlocks : [vpc.vpc.cidrBlock],
}],
dry-keyboard-94795
09/27/2023, 9:08 AMsecurityGroups
optionmagnificent-soccer-44287
09/27/2023, 9:12 AMdry-keyboard-94795
09/27/2023, 9:13 AMmagnificent-soccer-44287
09/27/2023, 10:00 AMdry-keyboard-94795
09/27/2023, 10:02 AMaws_acm_certificate
, then it'll usually be under pulumi as aws.acm.Certificate