0
0
GCPcloud~10 mins

Deployment Manager as native IaC in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the type of resource in Deployment Manager.

GCP
resources:
- name: my-vm
  type: [1]
Drag options to blanks, or click blank then click option'
Apubsub.v1.topic
Bstorage.v1.bucket
Ccompute.v1.instance
Dsqladmin.v1.instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using a storage bucket type instead of a VM instance type.
Confusing SQL instance type with compute instance type.
2fill in blank
medium

Complete the code to set the machine type for the VM instance.

GCP
resources:
- name: my-vm
  type: compute.v1.instance
  properties:
    zone: us-central1-a
    machineType: [1]
Drag options to blanks, or click blank then click option'
An1-standard-1
Bzones/us-central1-a/machineTypes/n1-standard-1
Czones/us-central1-a/instances/n1-standard-1
DmachineTypes/n1-standard-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the machine type name without zone path.
Confusing instance name with machine type.
3fill in blank
hard

Fix the error in the YAML to correctly define the disk size property.

GCP
resources:
- name: my-vm
  type: compute.v1.instance
  properties:
    disks:
    - deviceName: boot
      type: PERSISTENT
      boot: true
      autoDelete: true
      initializeParams:
        diskSizeGb: [1]
Drag options to blanks, or click blank then click option'
A10
B10GB
C'10GB'
D'10'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding units like 'GB' to the disk size value.
Using quotes around the number causing it to be a string.
4fill in blank
hard

Fill both blanks to define a firewall rule allowing TCP port 80.

GCP
resources:
- name: allow-http
  type: compute.v1.firewall
  properties:
    network: [1]
    allowed:
    - IPProtocol: [2]
      ports:
      - '80'
Drag options to blanks, or click blank then click option'
Aglobal/networks/default
Btcp
Cdefault
Dudp
Attempts:
3 left
💡 Hint
Common Mistakes
Using just 'default' instead of full network path.
Using UDP instead of TCP for HTTP traffic.
5fill in blank
hard

Fill all three blanks to create a metadata entry with key 'startup-script' and a simple echo command.

GCP
resources:
- name: my-vm
  type: compute.v1.instance
  properties:
    metadata:
      items:
      - key: [1]
        value: [2]
      - key: [3]
        value: 'ignored'
Drag options to blanks, or click blank then click option'
A'startup-script'
B'#!/bin/bash\necho Hello World'
C'shutdown-script'
D'echo Hello World'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around keys and values.
Using incorrect keys for metadata entries.