Skip to content
Merged
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
41 changes: 37 additions & 4 deletions internal/pkg/deploy/cloudformation/stack/transformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,16 +854,33 @@ func convertMountPoints(input map[string]*manifest.Volume) []*template.MountPoin
if len(input) == 0 {
return nil
}

// Sort by names for consistent testing
var names []string
for name := range input {
names = append(names, name)
}
sort.Strings(names)

var output []*template.MountPoint
for name, volume := range input {
for _, name := range names {
volume := input[name]
output = append(output, convertMountPoint(aws.String(name), volume.ContainerPath, volume.ReadOnly))
}
return output
}

func convertEFSPermissions(input map[string]*manifest.Volume) []*template.EFSPermission {
// Sort by names for consistent testing
var names []string
for name := range input {
names = append(names, name)
}
sort.Strings(names)

var output []*template.EFSPermission
for _, volume := range input {
for _, name := range names {
volume := input[name]
// If there's no EFS configuration, we don't need to generate any permissions.
if volume.EmptyVolume() {
continue
Expand Down Expand Up @@ -893,8 +910,16 @@ func convertEFSPermissions(input map[string]*manifest.Volume) []*template.EFSPer
}

func convertManagedFSInfo(wlName *string, input map[string]*manifest.Volume) *template.ManagedVolumeCreationInfo {
// Sort by names for consistent testing
var names []string
for name := range input {
names = append(names, name)
}
sort.Strings(names)

var output *template.ManagedVolumeCreationInfo
for name, volume := range input {
for _, name := range names {
volume := input[name]
if volume.EmptyVolume() || !volume.EFS.UseManagedFS() {
continue
}
Expand Down Expand Up @@ -923,8 +948,16 @@ func getRandomUIDGID(name *string) uint32 {
}

func convertVolumes(input map[string]*manifest.Volume) []*template.Volume {
// Sort by names for consistent testing
var names []string
for name := range input {
names = append(names, name)
}
sort.Strings(names)

var output []*template.Volume
for name, volume := range input {
for _, name := range names {
volume := input[name]
// Volumes can contain either:
// a) an EFS configuration, which must be valid
// b) no EFS configuration, in which case the volume is created using task scratch storage in order to share
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ Resources:
{{- end}}
{{- if .NestedStack}}{{$stackName := .NestedStack.StackName}}
{{- range $secret := .NestedStack.SecretOutputs}}
- Name: {{toSnakeCase $secret}}
Value:
Fn::GetAtt: [{{$stackName}}, Outputs.{{$secret}}]
- Name: {{toSnakeCase $secret}}
Value:
Fn::GetAtt: [{{$stackName}}, Outputs.{{$secret}}]
{{- end}}
{{- end}}
RuntimeEnvironmentVariables:
Expand Down