Skip to content

Commit

Permalink
Merge pull request #2486 from guardian/ecs-task-cpu-architecture
Browse files Browse the repository at this point in the history
Parameterise cpuArchitecture for GuEcsTask
  • Loading branch information
philmcmahon authored Oct 31, 2024
2 parents 4eaedc2 + 568165a commit ec0fb85
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-pots-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@guardian/cdk": major
---

Set CPU architecture of ECS tasks to ARM64
4 changes: 4 additions & 0 deletions src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ exports[`The GuEcsTask pattern should create the correct resources with lots of
"RequiresCompatibilities": [
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"Tags": [
{
"Key": "App",
Expand Down
6 changes: 6 additions & 0 deletions src/constructs/ecs/ecs-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import {
Cluster,
Compatibility,
ContainerImage,
CpuArchitecture,
FargatePlatformVersion,
LogDrivers,
OperatingSystemFamily,
TaskDefinition,
} from "aws-cdk-lib/aws-ecs";
import type { PolicyStatement } from "aws-cdk-lib/aws-iam";
Expand Down Expand Up @@ -203,6 +205,10 @@ export class GuEcsTask extends Construct {
memoryMiB: memory.toString(),
family: `${stack}-${stage}-${app}`,
ephemeralStorageGiB: storage,
runtimePlatform: {
cpuArchitecture: CpuArchitecture.ARM64,
operatingSystemFamily: OperatingSystemFamily.of("LINUX"),
},
});

const containerDefinition = taskDefinition.addContainer(`${id}-TaskContainer`, {
Expand Down

0 comments on commit ec0fb85

Please sign in to comment.