Deploy Admin Application

Enable Service Connect for the Core Application

1. Click Update service to update fcj-core-svc.

image

2. Check Force new deployment.

image

3. Scroll down to Service connect and configure:

  • Check Use Service Connect
  • Service Connect configuration: Select Client and server
  • Namespace: Select fcj-ecs-cluster-ns

image

4. Click Add port mappings and applications. Under Service Connect service - 1, configure:

  • Port alias: Select core-http
  • Discovery name: Enter core-http
  • DNS: Enter core
  • Port: Enter 8080

This configuration allows the admin application to make requests to the core application using the URI http://core:8080, which corresponds to the specified DNS and Port.

image

5. Scroll to the bottom and click Update.

image


Create the Admin Application Task Definition

1. Click Create new task definition.

image

2. Configure the basic settings:

  • Task definition family: fcj-admin-fargate-td
  • Launch type: AWS Fargate

image

3. Set the resource allocation:

  • CPU: .25 vCPU
  • Memory: .5 GB

image

4. For Task execution role, select fcjEcsTaskExecutionRole.

image

5. Open a new browser tab and navigate to Amazon ECR. Copy the admin image URI.

image

6. Return to the task definition tab. In the Container details section, configure:

  • Name: admin
  • Image URI: Paste the admin image URI you copied

image

7. Configure the container networking:

  • Container port: 80
  • Port name: admin-http

image

8. Click Add environment variable.

image

9. Configure the environment variable:

  • Key: REACT_BASE_URL
  • Value: http://core:8080/api/

image

10. Review your configuration and click Create.

image


Creating The Admin Application Service

1. Click Create to create a new service.

image

2. Configure the task definition and service:

  • Task definition family: Select fcj-admin-fargate-td
  • Service name: Enter fcj-admin-svc

image

3. Configure compute options:

  • Launch type: Select FARGATE

image

4. For Desired tasks, enter 1.

image

5. Configure networking:

  • VPC: Select fcj-vpc
  • Subnets: Select the two private subnets

image

6. Configure security and IP settings:

  • Security group: Select fcj-private-sg
  • Public IP: Disable

image

7. Configure Service Connect:

  • Check Use Service Connect
  • Service Connect configuration: Select Client side only
  • Namespace: Select fcj-ecs-cluster-ns

image

8. Check Use load balancing.

image

9. Configure load balancer:

  • Select Use an existing load balancer
  • Choose fcj-alb

image

10. Configure listener and target group:

  • Listener: Select Create new listener
  • Port: Enter 81
  • Target group: Select Create new target group
  • Target group name: Enter fcj-admin-tg

image

11. Review your configuration and click Create.

image

12. Wait for the service to be created (this may take a few minutes). Navigate to your ALB, copy the DNS name, and append :81 to it.

Example: fcj-alb-1993471058.ap-southeast-1.elb.amazonaws.com:81

image

13. Paste the URL into your browser to access the admin application.

image

14. Use admin for both Username and Password to log in and access the dashboard.

image