mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
fix iot updatemask and docs (#1640)
This commit is contained in:
parent
0497eec580
commit
d424cf05ba
@ -243,7 +243,7 @@ func resourceCloudIoTRegistryUpdate(d *schema.ResourceData, meta interface{}) er
|
||||
|
||||
if d.HasChange("event_notification_config") {
|
||||
hasChanged = true
|
||||
updateMask = append(updateMask, "event_notification_config")
|
||||
updateMask = append(updateMask, "event_notification_configs")
|
||||
if v, ok := d.GetOk("event_notification_config"); ok {
|
||||
deviceRegistry.EventNotificationConfigs = make([]*cloudiot.EventNotificationConfig, 1, 1)
|
||||
deviceRegistry.EventNotificationConfigs[0] = buildEventNotificationConfig(v.(map[string]interface{}))
|
||||
@ -251,21 +251,21 @@ func resourceCloudIoTRegistryUpdate(d *schema.ResourceData, meta interface{}) er
|
||||
}
|
||||
if d.HasChange("state_notification_config") {
|
||||
hasChanged = true
|
||||
updateMask = append(updateMask, "state_notification_config")
|
||||
updateMask = append(updateMask, "state_notification_config.pubsub_topic_name")
|
||||
if v, ok := d.GetOk("state_notification_config"); ok {
|
||||
deviceRegistry.StateNotificationConfig = buildStateNotificationConfig(v.(map[string]interface{}))
|
||||
}
|
||||
}
|
||||
if d.HasChange("mqtt_config") {
|
||||
hasChanged = true
|
||||
updateMask = append(updateMask, "mqtt_config")
|
||||
updateMask = append(updateMask, "mqtt_config.mqtt_enabled_state")
|
||||
if v, ok := d.GetOk("mqtt_config"); ok {
|
||||
deviceRegistry.MqttConfig = buildMqttConfig(v.(map[string]interface{}))
|
||||
}
|
||||
}
|
||||
if d.HasChange("http_config") {
|
||||
hasChanged = true
|
||||
updateMask = append(updateMask, "http_config")
|
||||
updateMask = append(updateMask, "http_config.http_enabled_state")
|
||||
if v, ok := d.GetOk("http_config"); ok {
|
||||
deviceRegistry.HttpConfig = buildHttpConfig(v.(map[string]interface{}))
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ resource "google_pubsub_topic" "default-telemetry" {
|
||||
resource "google_cloudiot_registry" "foobar" {
|
||||
depends_on = ["google_project_iam_binding.cloud-iot-iam-binding"]
|
||||
|
||||
name = "psregistry-test-%s"
|
||||
name = "%s"
|
||||
|
||||
event_notification_config = {
|
||||
pubsub_topic_name = "${google_pubsub_topic.default-devicestatus.id}"
|
||||
|
@ -6,11 +6,11 @@ description: |-
|
||||
Creates a device registry in Google's Cloud IoT Core platform
|
||||
---
|
||||
|
||||
# google\cloudiot\_registry
|
||||
# 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).
|
||||
[API](https://cloud.google.com/iot/docs/reference/cloudiot/rest/v1/projects.locations.registries).
|
||||
|
||||
|
||||
## Example Usage
|
||||
|
Loading…
Reference in New Issue
Block a user