Infrastructure as Code
Infrastructure as Code (IAC) is the process of provisioning and managing infrastructure (VM/Storage/Network etc.) by means of using code / configuration files.
Terraform
Terraform is an open-source Infrastructure as code tool that can work with multiple cloud providers such as AWS, GCP, Azure etc.
Terraform Example
The goal is to be able to invoke a terraform call to provision an AWS EC2 instance, install and configure a web server, and run a simple, static website on the instance. My blog post has all the commands and detailed steps - https://executeoncommand.com/?p=1193
Pre-requisites:
Sign up for an AWS account & use free tier
Default Virtual Private Cloud (VPC)
Default subnet in the above VPC
I believe by default you will get the above AWS components when you create an AWS account for the first time. If you don't see it in your AWS account, please use the below resources for the set up.
Resources:
My blog post - https://executeoncommand.com/?p=1193
VPC -- • Amazon Virtual Private Cloud (VPC) | ...
Code - https://github.com/jmbharathram/execu...
AWS CLI - https://docs.aws.amazon.com/cli/lates...
Timestamps
0:00 Intro
0:53 Demo Prerequisites
1:56 Terraform Setup
2:45 Demo Steps
3:30 Preparing EC2 instance for running Terraform
4:45 Terraform config file
6:25 Hashicorp Language Syntax
9:30 Terraform init command
10:00 Terraform plan command
10:45 Terraform apply command
11:30 Checking the static website
Subscribe:
/ @executeoncommand
Connect with me:
/ bharathramdba
Cheers
Bharath