- Create a VM instance with the following properties
- name: instance-1
- type: e2-micro
- labels:
- app: web
- env: dev
- Using the CLI (gcloud) perform the following operations:
- Update "app" label to "db"
- Remove "env" label
- Go to Compute Engine -> VM instances
- Click on "Create Instance"
- Insert the name "instance-1"
- Click on "Add label" and add the following labels:
- app: web
- env: dev
- Choose machine type: e2-micro
- Click on "Create"
- Selected the created instance and click on "show info panel"
- Click on "labels" tab and change the value of "app" label to "db"
- Remove the "env" label
gcloud config set project <PROJECT_ID>
gcloud config set compute/region <REGION NAME>
gcloud config set compute/zone <ZONE NAME>
gcloud compute instances create instance-1 --labels app=web,env=dev --machine-type=e2-micro
gcloud compute instances update instance-1 --update-labels app=db
gcloud compute instances update instance-1 --remove-labels env
Click here to view the main.tf file