0
0
GCPcloud~30 mins

Deploying workloads in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Deploying Workloads on Google Cloud Platform
📖 Scenario: You are working as a cloud engineer for a small company. Your task is to deploy a simple web application workload on Google Cloud Platform (GCP) using Compute Engine virtual machines.This project will guide you step-by-step to create the necessary resources and configurations to deploy your workload successfully.
🎯 Goal: By the end of this project, you will have created a Compute Engine instance with a startup script that deploys a simple web server. You will configure the instance to allow HTTP traffic and verify the deployment setup.
📋 What You'll Learn
Create a Compute Engine instance with a specific name and machine type
Add a startup script to install and start a web server
Configure the instance to allow HTTP traffic
Verify the instance configuration for deployment readiness
💡 Why This Matters
🌍 Real World
Deploying workloads on cloud virtual machines is a common task for running web applications, databases, and other services.
💼 Career
Cloud engineers and DevOps professionals regularly create and configure compute instances to deploy and manage workloads in production environments.
Progress0 / 4 steps
1
Create a Compute Engine instance resource
Create a variable called instance_config that is a dictionary with these exact keys and values: "name": "web-server-1", "machine_type": "e2-micro", and "zone": "us-central1-a".
GCP
Need a hint?

Use a Python dictionary with keys exactly as name, machine_type, and zone.

2
Add a startup script to install a web server
Add a key "startup_script" to the instance_config dictionary with the value set to the string "#!/bin/bash\nsudo apt-get update && sudo apt-get install -y apache2 && sudo systemctl start apache2".
GCP
Need a hint?

The startup script runs commands to update packages, install Apache2, and start the service.

3
Configure the instance to allow HTTP traffic
Add a key "allow_http" to the instance_config dictionary and set its value to True.
GCP
Need a hint?

Setting allow_http to True enables HTTP traffic to the instance.

4
Complete the deployment configuration
Create a variable called deployment_config that is a dictionary with a single key "compute_instance" whose value is the instance_config dictionary.
GCP
Need a hint?

This final dictionary groups the instance configuration under the key compute_instance.