๐๏ธ Infrastructure as Code
Avature Home Project
The idea is to write Terraform code for AWS, and we'll use a great tool called LocalStack to test it. LocalStack is a cloud service emulator that runs in a single container on your laptop, so you can test your Terraform code on your local machine without connecting to a remote cloud provider!
To install it, you only need Python 3.8.10 or higher and pip3, and you can simply run:
pip install localstack
Once installed, you can start it by running:
localstack start
You've been tasked with creating two EC2 instances using Terraform.
In this repository you'll find a _providers.tf
file ready to connect to your LocalStack instance running in the default ports (if you modified the default LocalStack configs, please adapt the file to refer to your specific configuration).
There's also a file called _avature.tf
, which contains the VPC, subnet and security group definition that you will be asked to use in the home project. These three resources will be created when you run terraform apply
for the first time. Please don't edit this file, only use the resources declared in it.
A team called "NLP" has asked you to create two EC2 instances to try out their new tool. The subnet and security group to be used have already been provided to you. This is what they should look like:
Instance name | Instance type | AMI ID | Subnet | Security groups | Key name |
---|---|---|---|---|---|
avature-service-1 | T3a medium | ami-q1w2e3r4t5y6r7l8z | NLP | allow_tls | john.doe.qa |
avature-service-2 | M5 xlarge | ami-a1v2a3t4u5r6e7rlz | NLP | allow_tls | jane.doe.qa |
Here are the specific tasks:
- Each instance should have at least four tags:
- The resource tag should be
instance
. - The environment tag should be
dev
. - The owner tag should include the team name, capitalized.
- The slug tag should be a string that joins the environment, team and instance name with underscores, all in lowercase (i.e.
qa_devops_awesometool-1
).
- Each instance should have two outputs:
- Instance ID
- Instance private IP
- Optional: The NLP team also mentioned it'd be great to have an encrypted EBS volume for the
avature-service-2
instance. They told you that, if possible, it should be a 200G disk attached to/dev/xvdf
.
- Take your time to organize the project as you like.
- Feel free to use any tools to write or debug your code.
Besides the _avature.tf
file, yes, no problem at all. Tweak anything you need.
Sure, go ahead, as long as the team has access to their instances, feel free to add anything you feel would have a positive impact.
Yes. We will evaluate the home project comprehensively, not only the working solution but also the conventions you follow in your Terraform codebase, the decisions you make and the reasoning behind them.
English, please.
Anything you feel will expand on your thought process behind the implemented solution will be a great addition.
It's expected that after completing and delivering the home project, it'll be showcased during the technical interview. Please get things ready so you have whatever components you need running on your own computer before the meeting.
Of course! Feel free to add whatever you consider will display your knowledge and experience.