AWS Free Website Hosting
Yes you heard that right, with AWS(Amazon Web Services) you can host your website free-of-cost, unless you have a AWS free tier account*
So, to give you a little hint about how we are going to do this, but before that forget not to SUBSCRIBE to my newsletter, this will keep me motivated 🙂
But why AWS Elastic Beanstalk ?
- Offers Quicker Deployment : ready to use infrastructure
- Supports Multi-Tenant Architecture : share your applications across different devices
- Simplifies Operations : auto configure servers, databases, firewalls, networks and many more
- Offers Complete Resource Control : freedom to select the AWS resources, like EC2 instance type.
What are AWS Elastic Beanstalk Components ?
- Application : Conceptually similar to a folder
- Application Version : labeled iteration of deployed code, points to an Amazon S3 object that contains the deployable code such as a Java WAR file
- Environment : environment where the current version of the application will be active
- Environment Tier : they are of 2 types
- Web Server Environment: Handles HTTP requests from clients
- Worker Environment: Processes background tasks which are resource consuming and time intensive
How to go with the deployment ?
Prerequisites
- Your code that needs to be deployed
- Your free tier account of AWS
- A cup of Coffee/Tea on the table 😁
Let’ssss gooooo!!!
Step 1 : Head to AWS Sign Up/Sign In console to be logged in to start the process.
Step 2 : Navigate to All Services and look for Elastic Beanstalk
Step 3 : Click on Create Application
Step 4 : Select the Web Server Environment, input the Application Name
Step 5 : Enter the platform type, and your required versions
Step 6 : Run the below command and create a zip of the project
Step 7 : Upload the zip of the file, select instance and click NEXT
Step 8 : Create and use new service role
Step 9 : Next we need to create EC2 key and EC2 instance profile using https://console.aws.amazon.com/ec2
Step 10 : Create a IAM role for EC2 instance profile
Step 11 : Under Add permission for EC2, select
- AWSElasticBeanstalkWebTier
- AWSElasticBeanstalkWorkerTier
- AWSElasticBeanstalkMulticontainerDocker
Step 12 : Create autoScale Group
Step 13 : Give name and create New Template
Step 14 : Select Key-value pair that you created with the free instance type
Step 15 : SKIP TO REVIEW and Create AutoScaling group
Step 16 : Head back to Elastic beanstalk website and refresh the section to select the Key Value pair and EC2 role we just created
Step 17 : Optionally you can add data servers, and other settings to your application, or maybe you can SKIP TO REVIEW and move to SUBMIT
Hurray!! you have published your first static Website and it’s live