forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Google Cloud IoT Core registry (hashicorp#970)
- Loading branch information
1 parent
825b11c
commit 411a268
Showing
2 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
layout: "google" | ||
page_title: "Google: google_cloudiot_registry" | ||
sidebar_current: "docs-google-cloudiot-registry-x" | ||
description: |- | ||
Creates a device registry in Google's Cloud IoT Core platform | ||
--- | ||
|
||
# google\cloudiot\_registry | ||
|
||
Creates a device registry in Google's Cloud IoT Core platform. For more information see | ||
[the official documentation](https://cloud.google.com/iot/docs/) and | ||
[API](https://cloud.google.com/iot/docs/reference/rest/v1/projects.locations.registries). | ||
|
||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "google_pubsub_topic" "default-devicestatus" { | ||
name = "default-devicestatus" | ||
} | ||
resource "google_pubsub_topic" "default-telemetry" { | ||
name = "default-telemetry" | ||
} | ||
resource "google_cloudiot_registry" "default-registry" { | ||
name = "default-registry" | ||
event_notification_config = { | ||
pubsub_topic_name = "${google_pubsub_topic.default-devicestatus.id}" | ||
} | ||
state_notification_config = { | ||
pubsub_topic_name = "${google_pubsub_topic.default-telemetry.id}" | ||
} | ||
http_config = { | ||
http_enabled_state = "HTTP_ENABLED" | ||
} | ||
mqtt_config = { | ||
mqtt_enabled_state = "MQTT_ENABLED" | ||
} | ||
credentials = [ | ||
{ | ||
public_key_certificate = { | ||
format = "X509_CERTIFICATE_PEM" | ||
certificate = "${file("rsa_cert.pem")}" | ||
} | ||
}, | ||
] | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) A unique name for the resource, required by device registry. | ||
Changing this forces a new resource to be created. | ||
|
||
- - - | ||
|
||
* `project` - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used. | ||
|
||
* `region` - (Optional) The Region in which the created address should reside. If it is not provided, the provider region is used. | ||
|
||
* `event_notification_config` - (Optional) A PubSub topics to publish device events. Structure is documented below. | ||
|
||
* `state_notification_config` - (Optional) A PubSub topic to publish device state updates. Structure is documented below. | ||
|
||
* `mqtt_config` - (Optional) Activate or deactivate MQTT. Structure is documented below. | ||
* `http_config` - (Optional) Activate or deactivate HTTP. Structure is documented below. | ||
|
||
* `credentials` - (Optional) List of public key certificates to authenticate devices. Structure is documented below. | ||
|
||
|
||
The `event_notification_config` block supports: | ||
|
||
* `pubsub_topic_name` - (Required) PubSub topic name to publish device events. | ||
|
||
The `state_notification_config` block supports: | ||
|
||
* `pubsub_topic_name` - (Required) PubSub topic name to publish device state updates. | ||
|
||
The `mqtt_config` block supports: | ||
|
||
* `mqtt_enabled_state` - (Required) The field allows `MQTT_ENABLED` or `MQTT_DISABLED`. | ||
|
||
The `http_config` block supports: | ||
|
||
* `http_enabled_state` - (Required) The field allows `HTTP_ENABLED` or `HTTP_DISABLED`. | ||
|
||
The `credentials` block supports: | ||
|
||
* `public_key_certificate` - (Required) The certificate format and data. | ||
|
||
The `public_key_certificate` block supports: | ||
|
||
* `format` - (Required) The field allows only `X509_CERTIFICATE_PEM`. | ||
* `certificate` - (Required) The certificate data. | ||
|
||
|
||
## Attributes Reference | ||
|
||
Only the arguments listed above are exposed as attributes. | ||
|
||
## Import | ||
|
||
A device registry can be imported using the `name`, e.g. | ||
|
||
``` | ||
$ terraform import google_cloudiot_registry.default-registry projects/{project}/locations/{region}/registries/{name} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters