AWS Terraform Assignment – Lab
Scope
A Lab to host a simple web application on Linux OR Windows EC2 instances, take screenshot of key outputs, upload it the repo.
Problem Statement
Requirement #1
Create a VPC with Internet Gateway, a set of public & private subnets in 3 availability zones
Define a Security Group for all the 3 EC2 instances
Setup 3 EC2 instances - Linux OR Windows on public subnet with Apache/Nginx OR IIS configured on port 80
Add a 2GB EBS volume per instance.
Ensure the default index.html page is accessible. Index.html should show the IP address of the instance serving request.
Setup an Application Load Balancer to distribute traffic to the 3 instances servers in a round-robin fashion which means that requests to the Application Load Balancer on port 80 will get re-directed to the 3 different servers.
Validate website is being served over ALB public DNS
Important Note: You may either create both the instances of Linux or both of Windows
Requirement #2 (Enhancement after finishing Requirement #1)
Create an AMI out of Linux /Windows EC2 Instances (Note: This step can be done manually. This AMI will be used for the next steps in setting up autoscaling using terraform)
Modify the existing TF code to create Launch Configurations with the AMIs created in previous step with the same instance specification as in RFE #1
Modify the existing TF code to create Auto Scaling Group (ASG) with the above Launch Configurations to scale in when CPU > 80% and scale out when CPU < 80%
Requirement #3 (Enhancement after finishing Requirement #2)
Create a CloudFront distribution -> WebDistribution and point to ALB public endpoint
Services to be used
EC2 - Linux & Windows, EBS, ALB, ASG, S3, VPC, CloudFront
Add anything else needed.
Tools needed
Install these tools before the start of the event
IDE ( VS Code, Intellj, Atom) – as per your preference
GIT CLI
Terraform CLI7
Github Repo: https://github.com/<your repo>
Folder Structure
Web101-<FirstName>-<SecondName>
TerraformCode
[Please add Requirement 1, 2 or 3 in the commit message. Its fine if you commit more than once for a requirement]
Commit 1 – Requirement 1
Commit 2 – Requirement 2
Commit 3 – Requirement 3
Output
Screenshots for Requirement 1
Screenshots for Requirement 2
Screenshots for Requirement 3
Result
Write the terraform code for all the pieces (exception: AMI creation in Req #2 can be manual)
Have a gitignore file to ignore .tfstate files and .terraform directory
Run the Terraform code to provision resources in the AWS Account
Execute the terraform code and take screenshots of key services / outputs.
Take full browser screenshot with SSO Login / email on the top right corner of AWS Console.
FAQs
Duration
3 hours once they start.
For the interns taking this test remotely, Session to be screen shared and recorded. HR to initiate the call, start recording and exit.
No comments:
Post a Comment