Tổ chức Stack

Tổ chức Stack

  1. Mở file root Fcj2024CdkApp

Architect

  1. Tạo ApiStack với id là Api
ApiStack apiStack = new ApiStack(app, "Api", StackProps.builder()
                .build(), 
                new ApiStackProps(
                        nlbStack.getNetworkLoadBalancer(),
                        nlbStack.getVpcLink()));

Architect

  1. Add environment and tags to the ApiStack.
   .env(environment)
   .tags(infraTags)

Architect

  1. Add a dependency to ensure that the Network Load Balancer (NLB) is created before the API Gateway.
apiStack.addDependency(nlbStack);

Architect

Resource Check

  1. In the AWS console interface, navigate to API Gateway.

    Architect

  2. Within the API Gateway interface, select APIs to find an API named ECommerceAPI that has been created.

    Architect

  3. Choose ECommerceAPI and then select GET.

    Architect

Test API on Postman

  1. Within the ECommerceAPI interface, navigate to Stages and copy the Invoke URL.

    Architect

  2. Open Postman and create a GET request with the path Invoke URL/product.

    Architect