On the ECS dashboard, select Clusters from the left menu.
Click the Create cluster button.
Enter a Cluster name (Example: Ecommerce-AI-Cluster).
In the Infrastructure section, ensure the AWS Fargate (serverless) option is checked. Click Create and wait about 1 minute for the cluster to be created.
Step 2: Create a Service within the Cluster
Click on the name of the Cluster you just created.
In the Services tab, click the Create button.
Under Compute options, ensure Fargate is selected.
Under Deployment configuration:
Task definition: Open the dropdown and select the ecommerce-ai-task you created in step 4.4.3.
Service name: Enter a name for this service (Example: ai-backend-service).
Step 3: Configure Networking and Security Group
Scroll down to the Networking section. You can leave the VPC and Subnets as default.
Under Security group, select Create a new security group.
Name it ai-backend-sg.
In the Inbound rules section, configure it as follows to allow traffic to reach your API:
Type: Custom TCP
Port range: 3500
Source: Anywhere (0.0.0.0/0)
Step 4: Deploy and Verify
Scroll to the bottom of the page and click Create.
AWS will begin provisioning resources and pulling your Image from ECR to run. This process takes about 2-3 minutes.
When the Status column of the service turns green with the word Active (or Running), your AI Backend is officially online!