lemniskett.moe/content/writeups/google-cloudskillsboost/GSP301/index.md
Hiiruki 7b9ef422a0
writeups/google-cloudskillsboost: [GSP301]
Deploy a Compute Instance with a Remote Startup Script
2023-09-06 22:25:28 +07:00

3.9 KiB

title description summary date draft author tags canonicalURL showToc TocOpen TocSide hidemeta comments disableHLJS disableShare hideSummary searchHidden ShowReadingTime ShowBreadCrumbs ShowPostNavLinks ShowWordCount ShowRssButtonInSectionTermList cover
[GSP301] Deploy a Compute Instance with a Remote Startup Script Quest: Cloud Architecture: Design, Implement, and Manage 2023-05-26T11:30:03+07:00 false Hiiruki
writeups
challenge
google-cloudskillsboost
gsp301
google-cloud
cloudskillsboost
juaragcp
google-cloud-platform
gcp
cloud-computing
cloud
cloud-architecture
true false right false false true true false false true true true true true
image alt caption relative hidden
<image path/url> <alt text> <text> false true

GSP301

Lab Banner

  • Time: 1 hour
  • Difficulty: Intermediate
  • Price: 5 Credits

Lab: GSP301
Quest: Cloud Architecture: Design, Implement, and Manage

🔄 Last updated: Sep 06, 2023

Challenge scenario

You have been given the responsibility of managing the configuration of your organization's Google Cloud virtual machines. You have decided to make some changes to the framework used for managing the deployment and configuration machines - you want to make it easier to modify the startup scripts used to initialize a number of the compute instances. Instead of storing startup scripts directly in the instances' metadata, you have decided to store the scripts in a Cloud Storage bucket and then configure the virtual machines to point to the relevant script file in the bucket.

A basic bash script that installs the Apache web server software called install-web.sh has been provided for you as a sample startup script. You can download this from the Student Resources links on the left side of the page.

Your challenge

Configure a Linux Compute Engine instance that installs the Apache web server software using a remote startup script. In order to confirm that a compute instance Apache has successfully installed, the Compute Engine instance must be accessible via HTTP from the internet.

Task 1. Confirm that a Google Cloud Storage bucket exists that contains a file

Go to cloud shell and run the following command:

gsutil mb gs://$DEVSHELL_PROJECT_ID
gsutil cp gs://sureskills-ql/challenge-labs/ch01-startup-script/install-web.sh gs://$DEVSHELL_PROJECT_ID

Task 2. Confirm that a compute instance has been created that has a remote startup script called install-web.sh configured

gcloud compute instances create example-instance --zone=us-central1-a --tags=http-server --metadata startup-script-url=gs://$DEVSHELL_PROJECT_ID/install-web.sh

Task 3. Confirm that a HTTP access firewall rule exists with tag that applies to that virtual machine

gcloud compute firewall-rules create allow-http --target-tags http-server --source-ranges 0.0.0.0/0 --allow tcp:80

Task 4. Connect to the server ip-address using HTTP and get a non-error response

After firewall creation (Task 3) just wait and then check the score

Congratulations!

Congratulations Badge