Launching An Application using Terraform (through EFS)
Apurv Waghmare
6k+ & Growing Linkedin Family|| DevOps Specialist at Amdocs || Docker || Kubernetes || 1X AWS || 2X Azure || Ansible || Terraform || Jenkins ||SAFe 6 certified
- Create Security group which allow the port 80.
- Launch EC2 instance.
- In this EC2 instance use existing key or provided key and security group .
- Launch one Volume using the EFS service and attach it in your vpc, then mount that volume into /var/www/html.
- Developer have uploaded the code into github repo also the repo has some images. - Copy the github repo code into /var/www/html.
- Create S3 bucket, and copy/deploy the images from github repo into the s3 bucket and change the permission to public readable.
- Create a Cloudfront using s3 bucket(which contains images) and use the Cloudfront URL to update in code in /var/www/html.
STEP1: Login with CLI then use aws configure command and give the access key, secret key from credential file and region name.
STEP2: Create a directory and then create a file inside it with “.tf” extension.
STEP3: Give the name of the provider(AWS) to whom the Terraform will contact.
STEP 4: Creating Security group with allowing Port 80 For http and Port 22 For ssh.
STEP 5: Launch EC2 instances
STEP 6: Launch one Volume using the EFS service and attach it in your vpc, then mount that volume into /var/www/html
STEP 7: Create S3 bucket, and copy deploy the images from github repo into the s3 bucket and change the permission to public readable
STEP 8: Create VPC ,Subnet ,Internet gateways, Routing tables
STEP 8. Create a Cloudfront using s3 bucket(which contains images) and use the Cloudfront URL to update in code in /var/www/html
Now, use the following commands to initialize and run the code.
Finally go to browser : https://52.66.244.80
?
We had successfully Launch Application using Terraform
Github link for the terraform code: https://github.com/apurvwagh/Terrainfra_code.git
Thanks for reading...