In this section, we will expose the web pages to the internet through a VPC load balancer so anyone can access them.
- Create a public load balancer to expose the web application. Access the Load balancers for VPC page and click Create.
- Set the following for the load balancer:
- Load balancer type: Application Load Balancer (ALB)
- Location: Location that you provision your VPC resources
- Details:
- Name: <initials>-web-lb
- Virtual private cloud: <initials>-workload-vpc
- Type: Public
- DNS type: Public
- Subnets: <initials>-workload-vsi-zone-1
- Backend pool:
- Name: <initials>-backend-pool
- Pool protocol: HTTP
- Health Port: 80
- Click Attach server + in the Back-end pools section and add the VSI that is in the subnet <initials>-workload-vsi-zone-1 with a server port of 80
- Create a front-end listener by clicking Create listener and set the following:
- Listener port: 80
- Under the Security Group section, unselect all except the one labeled <initials>-workload
- Click Create load balancer
- Allow access to the load balancer by adding the following inbound rule to the security group called <initials>-workload that the load balancer is attached.
- Allow internet access to the load balancer by adding the following rules to the Access control list for the ACL <initials>-workload-acl.
- It can take several minutes for your load balancer to provision. Check and wait until the status is set to Active in Load balancers for VPC. You may need click the refresh button in the page periodically.
- You web application is exposed:
- Retrieve the FQDN of your Load balancer
- Access the Load Balancer list and click your provisioned load balancer
- Copy the value under Hostname
- On your machine, open up a web browser pointing to
http://<Hostname of your load balancer>
. You may also test connectivity by issuing the following command:curl http://<Hostname of your load balancer>
- Retrieve the FQDN of your Load balancer