Skip to content

Add support for ephemeral storage configuration for Fargate tasks #1150

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

Open
wants to merge 2 commits into
base: mainline
Choose a base branch
from
Open
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions ecs-cli/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ecs-cli/modules/cli/compose/entity/entity_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func createRegisterTaskDefinitionRequest(taskDefinition *ecs.TaskDefinition, tag
PidMode: taskDefinition.PidMode,
IpcMode: taskDefinition.IpcMode,
PlacementConstraints: taskDefinition.PlacementConstraints,
EphemeralStorage: taskDefinition.EphemeralStorage,
}

if networkMode := taskDefinition.NetworkMode; aws.StringValue(networkMode) != "" {
Expand Down
68 changes: 34 additions & 34 deletions ecs-cli/modules/cli/compose/entity/mock/entity.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions ecs-cli/modules/cli/compose/entity/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ func (t *Task) buildRunTaskInput(taskDefinition string, count int, overrides map
return nil, err
}

ephemeralStorage, err := composeutils.ConvertToECSEphemeralStorage(ecsParams)
if err != nil {
return nil, err
}

// NOTE: this validation is not useful if called after RegisterTaskDefinition
if err := entity.ValidateFargateParams(ecsParams, launchType); err != nil {
return nil, err
Expand Down Expand Up @@ -364,6 +369,14 @@ func (t *Task) buildRunTaskInput(taskDefinition string, count int, overrides map
runTaskInput.LaunchType = aws.String(launchType)
}

if ephemeralStorage != nil {
if runTaskInput.Overrides == nil {
runTaskInput.Overrides = &ecs.TaskOverride{}
}

runTaskInput.Overrides.SetEphemeralStorage(ephemeralStorage)
}

tags, err := t.GetTags()
if err != nil {
return nil, err
Expand Down
Loading