⚙️ DevOps Day 5 — AWS CLI & CloudFormation Deep Dive
🚀 Introduction
💻 1. AWS CLI Overview
🧩 Setup
Install and configure AWS CLI:
Enter:
-
AWS Access Key ID -
AWS Secret Access Key -
Default region(e.g., ap-southeast-2) -
Output format(e.g., json)
Verify:
🖥️ 2. Launching an EC2 Instance via CLI
Example command:
This provisions a VM (EC2 instance) using the AWS API — fully scriptable and repeatable.
🔌 3. Connecting to an EC2 Instance
🔹 From the AWS Console (UI)
-
Open the EC2 Dashboard
-
Select your instance → Connect
-
Choose EC2 Instance Connect (browser-based SSH)
-
Click Connect to open a terminal session
🔹 From the Command Line
Make sure you have your private key file (.pem):
✅ You’re now connected to your VM via terminal.
🧱 4. AWS CloudFormation Template Walk-Through
CloudFormation is AWS’s native IaC tool — it lets you model and provision resources using YAML or JSON.
Example template (ec2.yaml):
Deploy it:
CloudFormation automatically interacts with the AWS API to create and configure your instance.
🔍 5. Drift Detection
Detect drift:
View the results in the AWS Console → CloudFormation → Drift Detection.
✅ Helps maintain consistency and trust in IaC-managed infrastructure.
🧠 6. DevOps Takeaways
-
AWS CLI gives you scriptable control over cloud resources.
-
CloudFormation enables version-controlled infrastructure.
-
Drift Detection keeps real resources aligned with templates.
-
Combined, they allow you to automate infrastructure safely and consistently.
🌟 Conclusion
“The CLI and CloudFormation are the DevOps engineer’s command center — bridging manual operations and true automation.”
Comments
Post a Comment