Note: As mentioned earlier, you can use images from either ECR or Dockerhub in this section.


Still within the ECS Console interface:

Enter the following information for the task definition:
fcjresbar-task-be
Next information:

In the container definition section, fill in the following details:
backend5000; protocol: TCP; App protocol: HTTP243When configuring containers in AWS Fargate, you don’t need to worry about the host port, as the host port will default to the container’s port.

Next, add environment variables, which are important. Without this configuration, the NodeJS server inside won’t run. These include:
MYSQL_USER = adminMYSQL_PASSWORD = letmein12345MYSQL_DATABASE = fcjresbarDB_HOST = “your rds endpoint”DB_DIALECT = mysqlPORT = 5000JWT_SECRET = 0bac010eca699c25c8f62ba86e319c2305beb94641b859c32518cb854addb5f4
Keep the default configurations.

Finally, click Create to create the task definition.

