DEV Community

Aravind kumar TS
Aravind kumar TS

Posted on

Cloudfront with EC2,S3 and Light Sail

𝐋𝐢𝐠𝐡𝐭 𝐒𝐚𝐢𝐥,Its a service in AWS that is used in order to create an instance along with APP, that is a OS+APP. Consider the scenario where in you want to host a website in EC2, there are lots of procedures for it. In Light sail its all simplified create a Light sail in the Light sail VPC. For example create a Light Sail instance that has Linux OS+ Word Press app.Create a Route 53 domain name. Once the domain name is created map it with the Light Sail instance Ip address. You can also use CDN ( Content Delivery Network) with Light Sail Instance so that the users who are closer to the region in which Light Sail instance is located can access the Light Sail instance with less latency. Light Sail instance located in a Light Sail VPC can be peered (VPC peering) only with the resources present in Default VPC. Light Sail is a fully managed service which means we need not manually do any patching or any sorts of maintenance for the Light Sail instance. Light Sail also has a Light Sail Load Balancer to which you can map target instances such that when huge traffic hits your Light Sail instance then the traffic gets distributed to the Light Sail Load Balancer's target instances.𝐂𝐥𝐨𝐮𝐝 𝐅𝐫𝐨𝐧𝐭,Content Delivery Network, as the name symbolizes. Cloud Front enables the user to access the resources mapped to it from nearby edge locations. Cloud Front aka CDN can be integrated with a EC2 along with Application Load Balancer and with a S3 static web site. Cloud front is a Global service which when mapped with EC2 or S3, it enables the users to access the EC2 or S3 resources from the nearby edge locations. An availability Zone is a data center whereas, edge location is the nearby data center for the user.𝐂𝐥𝐨𝐮𝐝 𝐅𝐫𝐨𝐧𝐭 𝐰𝐢𝐭𝐡 𝐄𝐜2 ,Consider the scenario where you have an EC2 with a website, and you have created an Application Load Balancer which uses protocols such as HTTP/HTTPS. You have created a Target group and mapped two EC2 instances for the traffic to get distributed. The user wants to access the EC2 (with website that you created) User experiences latency issues. In this case a Cloud front distribution is created and the origin is chosen as your ALB DNS Name. We can specify a CNAME ( Canonical Name) for your DNS. We can make the HTTP traffic request to hit the ALB as HTTPS. The protocol for HTTP is 80 and the protocol for HTTPS is 443. We can make the requests logs that hits the Cloud front Distribution to get stored in a S3 Bucket as well.𝐂𝐥𝐨𝐮𝐝 𝐅𝐫𝐨𝐧𝐭 𝐰𝐢𝐭𝐡 𝐒3.Consider the scenario where you have hosted a static website in S3. You can't make the users to hit the S3 static website hit directly its not recommended whereas when you create a Cloud front distribution and chose S3 as the origin.Then we can give the Cloud front distribution DNS to the users and make them to hit the website thus the S3 static website is protected.We can make the S3 website public,else we can block or make it only for IAM user #aws

Oldest comments (0)