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

Commit

Permalink
Efs: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Oct 18, 2024
1 parent 23cde01 commit dc4d359
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions platform/src/components/aws/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,22 +624,19 @@ export class Service extends Component implements Link.Linkable {
taskRoleArn: taskRole.arn,
volumes: output(containers).apply((containers) => {
const uniqueFileSystemIds: Set<string> = new Set();
return containers
.flatMap(
(container) =>
container.volumes?.map((volume) => {
if (uniqueFileSystemIds.has(volume.efs)) return;
uniqueFileSystemIds.add(volume.efs);
return {
name: volume.efs,
efsVolumeConfiguration: {
fileSystemId: volume.efs,
transitEncryption: "ENABLED",
},
};
}),
)
.filter((v) => !!v);
return containers.flatMap((container) =>
(container.volumes ?? []).flatMap((volume) => {
if (uniqueFileSystemIds.has(volume.efs)) return [];
uniqueFileSystemIds.add(volume.efs);
return {
name: volume.efs,
efsVolumeConfiguration: {
fileSystemId: volume.efs,
transitEncryption: "ENABLED",
},
};
}),
);
}),
containerDefinitions: $jsonStringify(
all([
Expand Down

0 comments on commit dc4d359

Please sign in to comment.