Skip to content

Commit

Permalink
Allow sidecar containers to be marked as essential
Browse files Browse the repository at this point in the history
Implements hashicorp#4884
  • Loading branch information
izeau committed Aug 15, 2023
1 parent 01b5f91 commit a3519e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/aws/ecs/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ func (p *Platform) resourceTaskDefinitionCreate(
}

c := &ecs.ContainerDefinition{
Essential: aws.Bool(false),
Essential: aws.Bool(container.Essential),
Name: aws.String(container.Name),
Image: aws.String(container.Image),
PortMappings: []*ecs.PortMapping{
Expand Down Expand Up @@ -2866,6 +2866,11 @@ type ContainerConfig struct {
// The container health check command
HealthCheck *HealthCheckConfig `hcl:"health_check,block"`

// If the essential parameter of a container is marked as true, and that container fails
// or stops for any reason, all other containers that are part of the task are stopped.
// Note: Contrary to the container definition API, this defaults to false.
Essential bool `hcl:"essential,optional"`

// The environment variables to pass to a container
Environment map[string]string `hcl:"static_environment,optional"`

Expand Down

0 comments on commit a3519e6

Please sign in to comment.