Tạo Application Load Balancer

Tạo Application Load Balancer

  1. Trước tiên chúng ta sẽ tạo Application Load Balancer (NLB). Để tạo SLB chúng ta cần khởi tạo đối tượng applicationLoadBalancer trong contructor
this.applicationLoadBalancer = new ApplicationLoadBalancer(this, "Alb",
                ApplicationLoadBalancerProps.builder()
                        .build());

Architect

  1. Tiếp theo đặt tên cho NLB là ECommerceNlb bằng cách
.loadBalancerName("ECommerceAlb")

Architect

  1. Như đã để cập trước đó. Chúng ta sẽ khổng để NLB và ALB ngoài VPC nên chúng ta sẽ làm như sau
.internetFacing(false)
.vpc(nlbStackProps.vpc())

Architect