-
Notifications
You must be signed in to change notification settings - Fork 4k
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): add missing NLB task image options #30775
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 } from '../../../core'; | ||
import * as cxapi from '../../../cx-api'; | ||
import { FargateServiceBaseProps } from '../base/fargate-service-base'; | ||
|
@@ -31,6 +31,13 @@ export interface NetworkLoadBalancedFargateServiceProps extends NetworkLoadBalan | |
* @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; | ||
} | ||
|
||
/** | ||
|
@@ -79,10 +86,13 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic | |
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, | ||
dockerLabels: taskImageOptions.dockerLabels, | ||
command: taskImageOptions.command, | ||
entryPoint: taskImageOptions.entryPoint, | ||
Comment on lines
+89
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see similar properties available in |
||
}); | ||
container.addPortMappings({ | ||
containerPort: taskImageOptions.containerPort || 80, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly we should have some unit tests for these commands in
NetworkLoadBalancedEc2Service
. We have some similar test cases forApplicationLoadBalancedEc2Service
.