Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs-patterns): healthCheck property for ApplicationLoadBalancedFargateService #28797

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Construct } from 'constructs';
import { ISecurityGroup, SubnetSelection } from '../../../aws-ec2';
import { FargateService, FargateTaskDefinition } from '../../../aws-ecs';
import { FargateService, FargateTaskDefinition, HealthCheck } from '../../../aws-ecs';
import { FeatureFlags, Token } from '../../../core';
import * as cxapi from '../../../cx-api';
import { ApplicationLoadBalancedServiceBase, ApplicationLoadBalancedServiceBaseProps } from '../base/application-load-balanced-service-base';
Expand Down Expand Up @@ -29,6 +29,13 @@ export interface ApplicationLoadBalancedFargateServiceProps extends ApplicationL
* @default - A new security group is created.
*/
readonly securityGroups?: ISecurityGroup[];

/**
* The health check command and associated configuration parameters for the container.
*
* @default - Health check configuration from container.
*/
readonly healthCheck?: HealthCheck;
}

/**
Expand Down Expand Up @@ -82,6 +89,7 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc
const containerName = taskImageOptions.containerName ?? 'web';
const container = this.taskDefinition.addContainer(containerName, {
image: taskImageOptions.image,
healthCheck: props.healthCheck,
logging: logDriver,
environment: taskImageOptions.environment,
secrets: taskImageOptions.secrets,
Expand Down
Loading