Skip to content

Commit

Permalink
feat: update Fargate task definitions to use ARM64 architecture (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
mazyu36 authored Feb 16, 2025
1 parent 60d5fa6 commit f882cba
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
5 changes: 4 additions & 1 deletion lib/constructs/services/clickhouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ export class ClickHouse extends Construct implements ec2.IConnectable {
const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDefinition', {
cpu: taskDefCpu ?? 1024,
memoryLimitMiB: taskDefMemoryLimitMiB ?? 2048,
runtimePlatform: { cpuArchitecture: ecs.CpuArchitecture.X86_64 },
runtimePlatform: {
cpuArchitecture: ecs.CpuArchitecture.ARM64,
operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
},
volumes: [
{
name: 'clickhouse',
Expand Down
5 changes: 4 additions & 1 deletion lib/constructs/services/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export class Web extends Construct {
const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDefinition', {
cpu: taskDefCpu ?? 1024,
memoryLimitMiB: taskDefMemoryLimitMiB ?? 2048,
runtimePlatform: { cpuArchitecture: ecs.CpuArchitecture.X86_64 },
runtimePlatform: {
cpuArchitecture: ecs.CpuArchitecture.ARM64,
operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
},
});

const nextAuthSecret = new secretsmanager.Secret(this, 'NextAuthSecret', {
Expand Down
5 changes: 4 additions & 1 deletion lib/constructs/services/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export class Worker extends Construct {
const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDefinition', {
cpu: taskDefCpu ?? 1024,
memoryLimitMiB: taskDefMemoryLimitMiB ?? 2048,
runtimePlatform: { cpuArchitecture: ecs.CpuArchitecture.X86_64 },
runtimePlatform: {
cpuArchitecture: ecs.CpuArchitecture.ARM64,
operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
},
});

/**
Expand Down
9 changes: 6 additions & 3 deletions test/__snapshots__/langfuse-with-aws-cdk-dev.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,8 @@ exports[`snapshot test for dev 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -2534,7 +2535,8 @@ sudo service iptables save",
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -3047,7 +3049,8 @@ sudo service iptables save",
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down
9 changes: 6 additions & 3 deletions test/__snapshots__/langfuse-with-aws-cdk-prod.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,8 @@ exports[`snapshot test for prod 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -2883,7 +2884,8 @@ exports[`snapshot test for prod 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -3387,7 +3389,8 @@ exports[`snapshot test for prod 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down
9 changes: 6 additions & 3 deletions test/__snapshots__/langfuse-with-aws-cdk-stg.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@ exports[`snapshot test for stg 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -2503,7 +2504,8 @@ exports[`snapshot test for stg 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -3007,7 +3009,8 @@ exports[`snapshot test for stg 1`] = `
"FARGATE",
],
"RuntimePlatform": {
"CpuArchitecture": "X86_64",
"CpuArchitecture": "ARM64",
"OperatingSystemFamily": "LINUX",
},
"TaskRoleArn": {
"Fn::GetAtt": [
Expand Down

0 comments on commit f882cba

Please sign in to comment.