diff --git a/ecs/awsResources.go b/ecs/awsResources.go index eb45b1ce..af5a5537 100644 --- a/ecs/awsResources.go +++ b/ecs/awsResources.go @@ -200,6 +200,7 @@ func (b *ecsAPIService) parseExternalVolumes(ctx context.Context, project *types return nil, err } if id == "" { + tags["Name"] = fmt.Sprintf("%s_%s", project.Name, vol.Name) logrus.Debug("no EFS filesystem found, create a fresh new one") id, err = b.aws.CreateFileSystem(ctx, tags) if err != nil { diff --git a/ecs/cloudformation_test.go b/ecs/cloudformation_test.go index d1e959e8..23a089a8 100644 --- a/ecs/cloudformation_test.go +++ b/ecs/cloudformation_test.go @@ -384,10 +384,6 @@ volumes: } func TestCreateVolume(t *testing.T) { - tags := map[string]string{ - compose.ProjectTag: t.Name(), - compose.VolumeTag: "db-data", - } testVolume(t, ` services: test: @@ -395,16 +391,19 @@ services: volumes: db-data: {} `, useDefaultVPC, func(m *MockAPIMockRecorder) { - m.FindFileSystem(gomock.Any(), tags).Return("", nil) - m.CreateFileSystem(gomock.Any(), tags).Return("fs-123abc", nil) + m.FindFileSystem(gomock.Any(), map[string]string{ + compose.ProjectTag: t.Name(), + compose.VolumeTag: "db-data", + }).Return("", nil) + m.CreateFileSystem(gomock.Any(), map[string]string{ + compose.ProjectTag: t.Name(), + compose.VolumeTag: "db-data", + "Name": fmt.Sprintf("%s_%s", t.Name(), "db-data"), + }).Return("fs-123abc", nil) }) } func TestReusePreviousVolume(t *testing.T) { - tags := map[string]string{ - compose.ProjectTag: t.Name(), - compose.VolumeTag: "db-data", - } testVolume(t, ` services: test: @@ -412,7 +411,10 @@ services: volumes: db-data: {} `, useDefaultVPC, func(m *MockAPIMockRecorder) { - m.FindFileSystem(gomock.Any(), tags).Return("fs-123abc", nil) + m.FindFileSystem(gomock.Any(), map[string]string{ + compose.ProjectTag: t.Name(), + compose.VolumeTag: "db-data", + }).Return("fs-123abc", nil) }) }