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 = google_pubsub_topic.foglamp-demo.id
}
resource "google_cloudiot_registry" "cloud-robotics" {
name = "cloud-robotics"
region = var.region
depends_on = [
google_project_service.cloudiot,
resource "google_cloudiot_registry" "this" {
http_config = var.http_config
log_level = var.log_level
mqtt_config = var.mqtt_config
name = var.name
project = var.project
resource "google_cloudiot_registry" "iot_poc_registry" {
name = "iot-poc-registry"
event_notification_configs {
pubsub_topic_name = google_pubsub_topic.default_telemetry.id
subfolder_matches = ""
resource "google_cloudiot_registry" "cvt_iot_registry" {
name = "cvt_iot_registry"
event_notification_configs {
pubsub_topic_name = google_pubsub_topic.iot_telemetry.id
subfolder_matches = ""
Parameters
-
http_config
optional computed - map from string to string
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"]
-
mqtt_config
optional computed - map from string to string
Activate or deactivate MQTT.
-
name
required - string
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.
-
state_notification_config
optional - map from string to string
A PubSub topic to publish device state updates.
-
credentials
list block-
public_key_certificate
required - map from string to string
A public key certificate format and data.
-
-
event_notification_configs
list block-
pubsub_topic_name
required - string
PubSub topic name to publish device events.
-
subfolder_matches
optional - string
If the subfolder name matches this string exactly, this configuration will be used. The string must not include the leading '/' character. If empty, all strings are matched. Empty value can only be used for the last 'event_notification_configs' item.
-
-
timeouts
single block
Explanation in Terraform Registry
A Google Cloud IoT Core device registry. To get more information about DeviceRegistry, see:
- API documentation
- How-to Guides
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.