Deploy AWS Amplify Container to Graviton 2

0

Hi, I have currently deployed a container-based API service to Fargate using AWS Amplify's CLI. However, the container sits on a 0.5cpu x86 instance. How would I go about deploying this with Amplify to a graviton-based instance, or specify memory-cpu configurations? Thanks.

Docker File: created by Amplify:

FROM public.ecr.aws/bitnami/node:14-prod-debian-10

ENV PORT=8080 EXPOSE 8080

WORKDIR /usr/src/app

COPY package*.json ./ RUN npm install COPY . .

CMD [ "node", "index.js" ]

1 個回答
0

If you are using AWS Fargate, you can build a task for x86_64 this way. The important parameter here is called cpuArchitecture :

{
 "family": "bb-arm64",
 "networkMode": "awsvpc",
 "containerDefinitions": [
    {
        "name": "sleep",
        "image": "arm64v8/busybox",
        "cpu": 100,
        "memory": 100,
        "essential": true,
        "command": [ "echo hello" ],
        "entryPoint": [ "sh", "-c" ]
    }
 ],
 "requiresCompatibilities": [ "FARGATE" ],
 "cpu": "1 vCpu",
 "memory": "3 GB",
 "runtimePlatform": { "cpuArchitecture": "ARM64" },
 "executionRoleArn": "arn:aws:iam::1234567890:role/ecsTaskExecutionRole"
}
profile picture
已回答 1 小時前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南