Terraform with AWS using EFS Full Automation.
Below services used to launch webserver on AWS.
1. Elastic Cloud Compute(EC2) is a part of Amazon’s cloud computing platform that allows users to rent virtual computers on which to run their own computer applications. It provides compute as a service to the users(CAAS).
2. Elastic File System(EFS) is a cloud storage service provided by (AWS) designed to provide scalable, elastic, concurrent with some restrictions and encrypted file storage for use with both AWS cloud
services and on-premises resources. In simple words, it provides File storage as a service(FSAAS).
3. Cloud Front is a content delivery network (CDN) offered by Amazon Web Services. Content delivery networks provide a globally distributed network of proxy servers which cache content, such as web videos or other bulky media, more locally to consumers, thus improving access speed for downloading the content.
Creating infrastructure as a code using terraform.
Below are the steps involved.
- Create the key-pair and security group which allow the port 80.
Launch an EC2 instance. In this EC2 instance use the key and security group which we have created in step 1.
Launch one storage volume (EFS) and attach that volume into the EC2 instance launched & mount the directory.
Create S3 bucket, and copy/deploy the static images into the S3 bucket and change the permission to public readable.
Create a Cloud Front using S3 bucket for images and use the Cloud Front URL to update in code.
Launch the application
Create Security group
In this security group , only ssh, http is allowed as webserver listen on port 80
Create EFS cluster with the encryption done on the data in rest.
Create ec2 instance and mount EFS which we create in earlier step.
S3 is used for content delivery globally.
Create cloud front
This the service that is provided by the AWS in which they create small data centres where they store our data to achieve low latency. It will create a Cloud Front distribution using an S3 bucket.
To apply user below