# Settings

NAME=wallaroo                   # change as required
ZONE=us-west1-a                 # For a complete list, use `gcloud compute zones list | egrep ^us-`
PROJECT=YOUR PROJECT ID     # Insert the GCP Project ID here

# Create VM

IMAGE=projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20231030

# Port 22 and 443 open by default

# If Edge Observability is enabled, also open ports 8081 and 8443, to admit incoming inference results.  This applies to the entire account and cannot be added a second time
# gcloud compute firewall-rules create allow-tcp-edge-ports --allow tcp:8081,tcp:8443  --network default  --target-tags edge-server
# gcloud compute instances add-tags jcw-test --tags edge-server

gcloud compute instances create $NAME \
    --project=$PROJECT \
    --zone=$ZONE \
    --machine-type=e2-standard-32 \
    --network-interface=network-tier=STANDARD,subnet=default \
    --maintenance-policy=MIGRATE \
    --provisioning-model=STANDARD \
    --no-service-account \
    --no-scopes \
    --tags=https-server \
    --create-disk=boot=yes,image=${IMAGE},size=500,type=pd-standard \
    --no-shielded-secure-boot \
    --no-shielded-vtpm \
    --no-shielded-integrity-monitoring \
    --reservation-affinity=any


# Get the external IP address
gcloud compute instances describe $NAME --zone $ZONE --format='get(networkInterfaces[0].accessConfigs[0].natIP)'
