Ujian Tengah Semester
Implementasi Solusi Cloud - E-Commerce Platform
02:00:00
Durasi
120 Menit
Bobot Nilai
30%
Platform
Pilih Platform
PENTING: Petunjuk Ujian
Kerja Individu
Ujian harus dikerjakan secara individu
Dilarang Plagiarisme
Tidak boleh menyalin solusi dari mahasiswa lain
Kelola Waktu
Ikuti timeline yang telah ditentukan
Informasi Umum Ujian
Format Ujian
- Jenis: Praktik Individu
- Durasi: 120 Menit
- Bobot: 30% Nilai Akhir
- Mode: Online Terawasi
Technical Requirements
- Akses ke Platform Cloud Pilihan
- Koneksi Internet Stabil
- SSH Client & Browser Modern
- Text Editor & Git
Deliverables
- Technical Documentation
- Source Code & Scripts
- Screenshot Evidence
- Demo Video (Opsional)
AWS
Amazon Web Services
Recommended
Huawei Cloud
Huawei Cloud Services
Available
OpenNebula
Private Cloud Platform
Available
Scenario: CloudShop E-Commerce Platform
Total: 100 Points
Latar Belakang
Anda ditugaskan sebagai Cloud Engineer untuk mengimplementasikan solusi cloud bagi startup e-commerce "CloudShop" yang membutuhkan platform sederhana dengan kemampuan menampilkan produk, keranjang belanja, dan checkout dasar.
Arsitektur Target
Internet Users
↓
Web Server
EC2/ECS (t3.small)
EC2/ECS (t3.small)
↓
Database Server
EC2/ECS (t3.micro)
EC2/ECS (t3.micro)
Cloud Storage
S3/OBS
S3/OBS
Monitoring
CloudWatch
CloudWatch
Backup System
Automated
Automated
Tugas 1: Infrastructure Setup
40 Points
Requirements
1.1 Virtual Machine Setup (15 points)
- 2 EC2/ECS instances dengan spesifikasi berbeda
- Web Server: t3.small atau setara
- Database Server: t3.micro atau setara
- Security group configuration
1.2 Storage Setup (10 points)
- Cloud storage bucket (S3/OBS)
- Upload minimal 5 gambar produk
- Bucket policy untuk public read access
1.3 Database Setup (15 points)
- Install MySQL/MariaDB
- Create database schema
- Insert sample data
Reference Commands
Database Schema
-- Tabel products
CREATE TABLE products (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10,2),
image_url VARCHAR(500),
stock INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Tabel orders
CREATE TABLE orders (
id INT AUTO_INCREMENT PRIMARY KEY,
customer_name VARCHAR(255),
customer_email VARCHAR(255),
total_amount DECIMAL(10,2),
status ENUM('pending','completed','cancelled'),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Security Group Rules
# Web Server Security Group
- HTTP (80) - 0.0.0.0/0
- HTTPS (443) - 0.0.0.0/0
- SSH (22) - Your IP only
# Database Security Group
- MySQL (3306) - Web Server IP only
- SSH (22) - Your IP only
Tugas 2: Application Deployment
40 Points
Requirements
2.1 Web Application Setup (20 points)
- Deploy aplikasi web e-commerce sederhana
- Halaman daftar produk
- Halaman detail produk
- Keranjang belanja session-based
- Form checkout sederhana
2.2 Web Server Config (10 points)
- Konfigurasi web server (Apache/Nginx)
- Virtual host dengan domain
- HTTPS dengan self-signed certificate
2.3 App Configuration (10 points)
- Environment variables
- Cloud storage integration
- Error handling & logging
Sample Flask Application
from flask import Flask, render_template, request, session, jsonify
import mysql.connector
import os
app = Flask(__name__)
app.secret_key = 'your_secret_key'
def get_db_connection():
return mysql.connector.connect(
host=os.getenv('DB_HOST', 'localhost'),
user=os.getenv('DB_USER', 'root'),
password=os.getenv('DB_PASSWORD', 'password'),
database=os.getenv('DB_NAME', 'cloudshop_db')
)
@app.route('/')
def index():
conn = get_db_connection()
cursor = conn.cursor(dictionary=True)
cursor.execute("SELECT * FROM products WHERE stock > 0")
products = cursor.fetchall()
cursor.close()
conn.close()
return render_template('index.html', products=products)
@app.route('/product/<int:product_id>')
def product_detail(product_id):
# Implementation product detail
pass
@app.route('/add-to-cart', methods=['POST'])
def add_to_cart():
# Implementation add to cart
pass
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
Tugas 3: Infrastructure Management
20 Points
Requirements
3.1 Monitoring Setup (10 points)
- Install & configure monitoring agent
- CPU utilization monitoring
- Memory usage tracking
- Disk I/O monitoring
- Network traffic monitoring
3.2 Backup & Recovery (10 points)
- Automated backup script untuk database
- Cron job untuk backup harian
- Simpan backup ke cloud storage
- Recovery testing procedure
Monitoring Script
#!/bin/bash
# monitoring.sh
echo "=== System Monitoring ==="
echo "CPU Usage: $(top -bn1 | grep "Cpu(s)" | awk '{print $2}')%"
echo "Memory Usage: $(free -h | grep Mem | awk '{print $3"/"$2}')"
echo "Disk Usage: $(df -h / | awk 'NR==2 {print $5}')"
echo "Network: $(cat /proc/net/dev | grep eth0 | awk '{print $2" RX, "$10" TX}')"
# Check web server status
if systemctl is-active --quiet nginx; then
echo "Web Server: ✅ Running"
else
echo "Web Server: ❌ Stopped"
fi
# Check database connection
if mysqladmin ping -h localhost -u root -p$DB_PASSWORD &> /dev/null; then
echo "Database: ✅ Connected"
else
echo "Database: ❌ Disconnected"
fi
Panduan Pengumpulan
1
Technical Documentation
Format PDF
2
Source Code
Git repository atau zip file
3
Screenshot Evidence
Successful deployment
4
Demo Video
3-5 menit (Opsional)
Checklist Pengumpulan
Progress: 0/8 (0%)
Kriteria Penilaian
| Kategori | Bobot | Kriteria | Deskripsi |
|---|---|---|---|
| Technical Implementation | 70% |
Infrastructure Setup: 25% Application Deployment: 25% Infrastructure Management: 20%
|
Kelengkapan dan kebenaran konfigurasi, keberhasilan deployment, functionality |
| Documentation & Best Practices | 30% |
Documentation Quality: 15% Code Quality: 10% Troubleshooting: 5%
|
Kelengkapan dokumentasi, struktur kode, kemampuan identifikasi dan resolusi masalah |
Quick Reference & Cheat Sheet
Database Setup
# Install MySQL
sudo apt update && sudo apt install mysql-server -y
# Secure installation
sudo mysql_secure_installation
# Create database and user
sudo mysql -u root -p
CREATE DATABASE cloudshop_db;
CREATE USER 'cloudshop_user'@'%' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON cloudshop_db.* TO 'cloudshop_user'@'%';
FLUSH PRIVILEGES;
Web Server Setup
# Install Apache & PHP
sudo apt install apache2 php libapache2-mod-php php-mysql -y
# Python alternative
sudo apt install python3-pip python3-venv -y
python3 -m venv myenv
source myenv/bin/activate
pip install flask mysql-connector-python
Monitoring Setup
# AWS CloudWatch Agent
sudo yum install amazon-cloudwatch-agent -y
# Basic monitoring script
#!/bin/bash
echo "CPU: $(top -bn1 | grep Cpu | awk '{print $2}')%"
echo "Memory: $(free -h | grep Mem | awk '{print $3"/"$2}')"
echo "Disk: $(df -h / | awk 'NR==2 {print $5}')"