đŠ️ DevOps Day 4 — Creating Virtual Machines in AWS and Azure
đ Introduction
Today, we’ll take it one step further — learning how virtual machines (VMs) are created and managed in AWS and Azure, and how DevOps engineers use different automation tools and APIs to provision them efficiently.
☁️ Understanding the Cloud VM Concept
In DevOps, creating VMs automatically through scripts, templates, or code is part of a broader concept called Infrastructure as Code (IaC) — a key principle that enables automation, repeatability, and scalability.
đ§ą AWS Free Tier Overview
-
t2.micro / t3.micro instance (1 vCPU, 1 GB RAM)
-
750 hours per month for 12 months
-
Ideal for testing deployments, automation, and CI/CD scripts
You can explore this from the AWS Management Console or directly through the AWS CLI and APIs.
đĨ️ Creating an EC2 Instance — 5 DevOps Methods
1. đ§° AWS Management Console (GUI)
This is the simplest, manual way:
-
Log in to your AWS Console
-
Navigate to EC2 → Launch Instance
-
Choose an AMI (Amazon Machine Image)
-
Select instance type (e.g.,
t2.micro) -
Configure key pair, security group, and network settings
-
Click Launch
Great for beginners, but not suitable for automation.
2. đģ AWS CLI (Command Line Interface)
DevOps engineers often automate VM creation using the AWS CLI:
✅ Benefits:
-
Reusable commands
-
Easy to integrate into shell scripts or CI/CD pipelines
3. ⚙️ AWS CloudFormation (Infrastructure as Code)
Example snippet:
Run via CLI:
✅ Benefits:
-
Version-controlled infrastructure
-
Repeatable and fully automated
4. đ Boto3 (AWS SDK for Python)
Boto3 allows developers to create and manage AWS resources programmatically using Python scripts.
Example:
✅ Benefits:
-
Integrates easily into automation frameworks
-
Ideal for dynamic or event-driven instance creation
5. đ§Š Terraform (HashiCorp IaC Tool)
Terraform is a multi-cloud IaC tool used widely in DevOps for provisioning and managing infrastructure.
Example main.tf:
Deploy with:
✅ Benefits:
-
Works across AWS, Azure, GCP
-
State management and dependency handling
-
Reusable modules for large-scale automation
đ¤ AWS CDK (Cloud Development Kit)
AWS CDK allows engineers to define cloud resources using familiar programming languages like Python, TypeScript, or Java.
Example:
✅ Benefits:
-
“Code-first” infrastructure
-
High-level abstraction for complex setups
-
Great for integrating with DevOps pipelines
đ Authentication & API Calls
-
Valid — Correctly formatted with proper parameters
-
Authenticated — Using access key/secret key or IAM role
-
Authorized — IAM policies must allow the requested actions
Once verified, AWS provisions the requested resources — securely and automatically.
đ§ Azure Comparison
Azure offers similar VM provisioning options:
-
Azure CLI (
az vm create) -
ARM Templates (Azure Resource Manager)
-
Azure SDKs for Python or .NET
-
Terraform or Bicep
Although syntax and tools differ, the DevOps principles remain the same — automation, repeatability, and scalability.
đ Conclusion
Creating virtual machines through automation tools like CLI, CloudFormation, Boto3, Terraform, and AWS CDK empowers DevOps teams to manage infrastructure like code — fast, reliable, and error-free.
“The power of DevOps lies not in clicking through consoles, but in scripting the cloud to build itself.”
Comments
Post a Comment