Advanced Architecture
SECURE DEPLOYMENT, BLUEPRINTS & CAREERS
Threat Modeling: Access Keys vs. IAM Roles
The Threat: GitHub Credential Leaks.
Hardcoding AWS Programmatic Access Keys in configuration files
(.env) or repository codebases
leaves system networks fully vulnerable to malicious automated
scanning bots.
- Access Key Static Vulnerability: Keys remain valid forever unless manually rotated. If leaked, unauthorized parties control your system endpoints.
- The Modern Enterprise Fix: Standardize on temporary token delegation via IAM Roles and machine-level instance profiles.
- Secret Management Principle: Applications must never store raw AWS credentials locally inside memory disks.
The Exploit Timeframe:
"Within 60 seconds of pushing a plaintext Access Key ID to a public repository, automated scanners will identify, compromise, and deploy thousands of high-cost computing units in your account."
Secure Machine-to-Machine Integration
IAM Roles for EC2 (Instance Profiles).
- Role Abstraction: An IAM Role is an identity with custom permission rules that can be assumed temporarily by an AWS compute resource.
- Trust Boundaries: Configure a trust policy authorizing EC2 to assume the role.
- Dynamic Credentials: AWS handles generating, injecting, and rotating the cryptographic tokens automatically every few hours.
THE ENTERPRISE FLOW
1. Attach IAM S3-Read Role to EC2
2. S3 SDK on EC2 requests Access Token
3. Token returned automatically from IMDS
4. Secure API call executed safely
Instance Metadata Service (IMDS)
How Servers Fetch Their Own Credentials.
The AWS SDK running in your application code queries a local, non-routable link-local IP address to get credentials.
http://169.254.169.254/latest/meta-data/iam/security-credentials/[role-name]
- Non-Routable: Traffic remains strictly within the virtualization card layer of that physical host. It cannot leave the server boundary.
- Auto-Discovery: SDKs automatically search this path if local environment variable credentials do not exist.
Hands-On Lab: S3 Image Uploader (Part 1)
The Baseline Test: Network Isolation.
We must prove our compute resource has absolutely no default access permissions to other AWS services before we assign our trust parameters.
- 1️⃣ Connect to your running EC2 machine via SSH or EC2 Instance Connect.
-
2️⃣ Run the S3 list query directly:
aws s3 ls. -
3️⃣ Observe the standard AWS API error:
"Unable to locate credentials". This proves local storage is private.
CONSOLE TRACE TARGET:
Ensure the local AWS CLI configuration does not contain any hardcoded access key values from your previous sandbox configuration tests.
Hands-On Lab: S3 Image Uploader (Part 2)
The Enterprise Fix: Delegate Machine Trust.
- 1️⃣ Open your **IAM Console**. Create a role with a trust relationship targeting Amazon EC2.
-
2️⃣ Attach the managed policy
AmazonS3ReadOnlyAccessto this IAM Role. - 3️⃣ Navigate back to your EC2 console, select your instance, and attach this role to the **Instance Profile**.
-
4️⃣ Re-run
aws s3 ls. The bucket lists succeed instantly without configuring keys!
➔ WHY THIS SUCCEEDED:
The AWS CLI automatically discovered that an IAM Role was attached to the machine, hit the metadata IP address, grabbed a temporary credentials token, and authorized the API call dynamically.
Hands-On Lab: S3 Image Uploader (Part 3)
Running the Programmatic Image Uploader.
Let's verify that our software code inherits this temporary machine-level authentication configuration natively.
- 1️⃣ Clone our pre-built image uploader repository directly onto your EC2 machine.
-
2️⃣ Run the app using your installed runtime:
bun startornpm start. - 3️⃣ Open the local server port. Try uploading an image file from your web browser.
- 4️⃣ Verify that the file lands securely inside your private S3 bucket without any hardcoded secret keys!
Real-World High-Availability Blueprint
The 3-Tier Enterprise Web Production Architecture:
Route 53 & CloudFront
DNS queries resolve on Route 53. Static files are cached globally on CloudFront edge locations, minimizing backend request traffic.
The Client Entry GateALB & Auto-Scaling
An Application Load Balancer distributes visitor traffic across EC2 instances managed inside an Auto-Scaling Group across Multi-AZs.
The Processing LayerMulti-AZ Amazon RDS
Database writes go to a Primary instance, while a Standby instance in a separate AZ replicates data synchronously for failover recovery.
The Data Storage LayerIntroduction to DevOps & Infrastructure as Code
From Manual Clicks to Automation Codebases.
Manual server configurations do not scale in enterprise operations. The modern DevOps paradigm standardizes on programmatic definitions.
- Infrastructure as Code (IaC): Define entire cloud networks, security policies, and storage pools using declaration codes (Terraform/CloudFormation).
- Consistency: Deploy identical environments (Dev/Staging/Production) with the exact same script configurations.
- GitOps Integration: Version control your infrastructure resources using Git repositories.
⚙️ THE DEVOPS FORMULA
Infrastructure as Code (IaC)
+ Automated CI/CD Pipelines
+ Continuous Monitoring (CloudWatch)
= Rapid, Stable Software Delivery
AWS Certification Pathways
Your Professional Credibility Roadmap:
- 1. Foundational (AWS Cloud Practitioner): The primary entry point. Verifies core cloud concepts and AWS pricing models.
- 2. Associate (Solutions Architect / Developer / SysOps): The baseline benchmark of professional systems engineering.
- 3. Professional & Specialty: Focuses on deep architectural design, security, networking, or machine learning engineering.
Nepal & Remote Career Landscapes
The Demand: Extreme Cloud Talent Shortage.
Standard programming skills are common. System engineers who understand cloud perimeters, secure delegation, and continuous deployment are rare and highly compensated.
- Local Market Trends: Nepal's enterprise sectors (banks, telecommunications, outsourcing agencies) are actively migrating to cloud models.
- Remote Opportunities: International companies heavily recruit remote cloud engineers on global pay rates if they can prove automated execution capabilities.
💼 CHOOSE YOUR PIPELINE
Cloud Architect (System Design)
DevOps Engineer (CI/CD, IaC, Automation)
Cloud Security Specialist (IAM, KMS, VPC)
Resume & Portfolio Construction
How to Get Noticed by Global Recruiters:
- The Code Portfolio: Certifications prove study; GitHub repositories prove execution. Host clean Terraform configurations.
- Real Project Scenarios: Document projects like "High-Availability Multi-AZ Web Fleets on AWS" or "Secure Serverless Frontends on S3."
- Technical Writing: Write brief technical guides on your setups (Medium/LinkedIn) to prove you can communicate complex architecture.
★ CV CHECKLIST
- S3 Static Web Hosting URLs
- Link to GitHub (Terraform/Node/Bun)
- Diagrammed Architectural Maps
- Decoupled System Case Studies
Mandatory Resource Teardown
Keep Your Account Safe & Within Free Tier limits.
- Compute Cleanup: Select all sandbox EC2 instances inside your console window and trigger **Terminate**.
- Storage Deletion: Empty your unique S3 buckets, then delete the containers completely.
- Security Group Policies: Delete custom inbound rule associations if they are no longer required.
⚠️ STOP THE BILLS
Do not leave active compute instances or files on S3 running indefinitely. Check your Billing Console to confirm absolute zero charge limits before leaving the class!