Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Latest commit

 

History

History
47 lines (35 loc) · 2.45 KB

GCPManualSetup.md

File metadata and controls

47 lines (35 loc) · 2.45 KB

How to create and configure Google Cloud Platform (GCP) project - Manually

Create a GCP project, enable billing and required API's

  1. In the GCP Console, go to the Manage resources page and select or create a new project. The project name will be your GOOGLE_IOT_PROJECT variable.

  2. Make sure that billing is enabled for your project.

  3. Enable the Cloud IoT Core, Compute and Cloud Pub/Sub APIs.

Create a device registry

  1. Go to the Google Cloud IoT Core page in GCP Console.
  2. Click Create a registry.
  3. Enter balena-registry for the Registry ID (this will be your GOOGLE_IOT_REGISTRY variable).
  4. Select us-central1 for the Cloud region (this will be your GOOGLE_IOT_REGION variable).
  5. Select MQTT for the Protocol.
  6. In the Telemetry topic dropdown list, select Create a topic.
  7. In the Create a topic dialog, enter balena-telemetry-topic in the Name field.
  8. Click Create in the Create a topic dialog.
  9. In the State topic dropdown list, select Create a topic.
  10. In the Create a topic dialog, enter balena-state-topic in the Name field.
  11. Click Create in the Create a topic dialog.
  12. Click Create on the Cloud IoT Core page.

You've just created a device registry with a Cloud Pub/Sub topic for publishing device telemetry events.

Create service account and credentials

  1. Go to the GCP IAM service accounts page
  2. Click Create service account
  3. Name it balena-service-account
  4. Click Create
  5. On the Roles dropdown add the following: Cloud IoT Provisioner and Pub/Sub Publisher
  6. Click Continue
  7. Click Create Key to create JSON keys for your service account.
  8. Download the credentials JSON file and click Done to complete the setup.

The contents of the credentials JSON file will be your GOOGLE_IOT_SERVICE_ACCOUNT_TOKEN variable.

Optional: Create subscription for testing

  1. Visit the PubSub subscriptions page
  2. Click Create Subscription
  3. Enter balena-telemetry-test-sub for the Subscription ID
  4. Enter projects/balenaio/topics/balena-telemetry-topic for the Topic name
  5. Leave the other settings at the default values and click Create