Skip to content

Commit d293ca2

Browse files
authored
fix: Fargate provider storage size setting doesn't work (#661)
- Corrected the logical grouping of the nullish coalescing operator and ternary operator for the ephemeralStorageGiB property. - Ensured that the ephemeralStorageGiB property is correctly set when provided in the props. - This fix ensures that the correct storage value is reflected in the synthesized CloudFormation template. - Prior to this fix the storage value would always be set to 25
1 parent 774d6d0 commit d293ca2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/providers/fargate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export class FargateRunnerProvider extends BaseProvider implements IRunnerProvid
435435
{
436436
cpu: props?.cpu ?? 1024,
437437
memoryLimitMiB: props?.memoryLimitMiB ?? 2048,
438-
ephemeralStorageGiB: props?.ephemeralStorageGiB ?? !image.os.is(Os.WINDOWS) ? 25 : undefined,
438+
ephemeralStorageGiB: props?.ephemeralStorageGiB ?? (!image.os.is(Os.WINDOWS) ? 25 : undefined),
439439
runtimePlatform: {
440440
operatingSystemFamily: os,
441441
cpuArchitecture: arch,

test/providers.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test('CodeBuild provider privileged', () => {
3939
Environment: {
4040
PrivilegedMode: true,
4141
},
42-
}), 2/*runners*/+3/*image builders*/);
42+
}), 2/*runners*/ + 3/*image builders*/);
4343

4444
template.hasResourceProperties('AWS::CodeBuild::Project', Match.objectLike({
4545
Environment: {
@@ -73,6 +73,7 @@ test('Fargate provider', () => {
7373
new FargateRunnerProvider(stack, 'provider', {
7474
vpc: vpc,
7575
securityGroups: [sg],
76+
ephemeralStorageGiB: 100,
7677
});
7778

7879
const template = Template.fromStack(stack);
@@ -87,6 +88,7 @@ test('Fargate provider', () => {
8788
Name: 'runner',
8889
},
8990
],
91+
EphemeralStorage: { SizeInGiB: 100 },
9092
}));
9193
});
9294

0 commit comments

Comments
 (0)