Google Cloud IoT Core Registry

This page shows how to write Terraform for Cloud IoT Core Registry and write them securely.

google_cloudiot_registry (Terraform)

The Registry in Cloud IoT Core can be configured in Terraform with the resource name google_cloudiot_registry. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "google_cloudiot_registry" "foglamp-demo-registry" {
    name     = "foglamp-demo-registry"

    event_notification_configs {
        pubsub_topic_name =
resource "google_cloudiot_registry" "cloud-robotics" {
  name   = "cloud-robotics"
  region = var.region

  depends_on = [
resource "google_cloudiot_registry" "this" {
  http_config               = var.http_config
  log_level                 = var.log_level
  mqtt_config               = var.mqtt_config
  name                      =
  project                   = var.project
resource "google_cloudiot_registry" "iot_poc_registry" {
  name = "iot-poc-registry"

  event_notification_configs {
    pubsub_topic_name =
    subfolder_matches = ""
resource "google_cloudiot_registry" "cvt_iot_registry" {
  name = "cvt_iot_registry"

  event_notification_configs {
    pubsub_topic_name =
    subfolder_matches = ""

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).


Activate or deactivate HTTP.

The default logging verbosity for activity from devices in this registry. Specifies which events should be written to logs. For example, if the LogLevel is ERROR, only events that terminate in errors will be logged. LogLevel is inclusive; enabling INFO logging will also enable ERROR logging. Default value: "NONE" Possible values: ["NONE", "ERROR", "INFO", "DEBUG"]

Activate or deactivate MQTT.

A unique name for the resource, required by device registry.

The region in which the created registry should reside. If it is not provided, the provider region is used.

A PubSub topic to publish device state updates.

Explanation in Terraform Registry

A Google Cloud IoT Core device registry. To get more information about DeviceRegistry, see:

Frequently asked questions

What is Google Cloud IoT Core Registry?

Google Cloud IoT Core Registry is a resource for Cloud IoT Core of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud IoT Core Registry?

For Terraform, the badal-io/dataflow-timeseries-iot-gas-demo, googlecloudrobotics/core and niveklabs/google source code examples are useful. See the Terraform Example section for further details.


Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.