In this recipe, we'll create a Linux instance and run a simple Flask application. In the web application, we'll write code to capture an error and send it to Stackdriver Error Reporting:
- Let's first create an instance to host our Flask application. Note that the access scope allows full access to all Cloud APIs:
$ gcloud compute instances create flask-instance --image=debian-9-stretch-v20180307 --image-project "debian-cloud" --machine-type=f1-micro --scopes cloud-platform --zone us-east1-c --tags flask-server --project <Project ID>
- Next, we'll open the firewall for this instance (network tag: flask-server) on port 5000:
$ gcloud compute firewall-rules create default-allow-http-5000 --allow tcp:5000 --source-ranges 0.0.0.0/0 ...