Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

[ECS] Allow sidecar containers to be marked as essential #4887

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 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 Expand Up @@ -3301,6 +3306,11 @@ deploy {
"The protocol used for port mapping.",
)

doc.SetField(
"essential",
"If true, and the container stops for any reason, all other containers are stopped",
)

doc.SetField(
"static_environment",
"Environment variables to expose to this container",
Expand Down