Skip to content

Commit d424cf0

Browse files
authored
fix iot updatemask and docs (#1640)
1 parent 0497eec commit d424cf0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

google/resource_cloudiot_registry.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -243,29 +243,29 @@ func resourceCloudIoTRegistryUpdate(d *schema.ResourceData, meta interface{}) er
243243

244244
if d.HasChange("event_notification_config") {
245245
hasChanged = true
246-
updateMask = append(updateMask, "event_notification_config")
246+
updateMask = append(updateMask, "event_notification_configs")
247247
if v, ok := d.GetOk("event_notification_config"); ok {
248248
deviceRegistry.EventNotificationConfigs = make([]*cloudiot.EventNotificationConfig, 1, 1)
249249
deviceRegistry.EventNotificationConfigs[0] = buildEventNotificationConfig(v.(map[string]interface{}))
250250
}
251251
}
252252
if d.HasChange("state_notification_config") {
253253
hasChanged = true
254-
updateMask = append(updateMask, "state_notification_config")
254+
updateMask = append(updateMask, "state_notification_config.pubsub_topic_name")
255255
if v, ok := d.GetOk("state_notification_config"); ok {
256256
deviceRegistry.StateNotificationConfig = buildStateNotificationConfig(v.(map[string]interface{}))
257257
}
258258
}
259259
if d.HasChange("mqtt_config") {
260260
hasChanged = true
261-
updateMask = append(updateMask, "mqtt_config")
261+
updateMask = append(updateMask, "mqtt_config.mqtt_enabled_state")
262262
if v, ok := d.GetOk("mqtt_config"); ok {
263263
deviceRegistry.MqttConfig = buildMqttConfig(v.(map[string]interface{}))
264264
}
265265
}
266266
if d.HasChange("http_config") {
267267
hasChanged = true
268-
updateMask = append(updateMask, "http_config")
268+
updateMask = append(updateMask, "http_config.http_enabled_state")
269269
if v, ok := d.GetOk("http_config"); ok {
270270
deviceRegistry.HttpConfig = buildHttpConfig(v.(map[string]interface{}))
271271
}

google/resource_cloudiot_registry_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ resource "google_pubsub_topic" "default-telemetry" {
135135
resource "google_cloudiot_registry" "foobar" {
136136
depends_on = ["google_project_iam_binding.cloud-iot-iam-binding"]
137137
138-
name = "psregistry-test-%s"
138+
name = "%s"
139139
140140
event_notification_config = {
141141
pubsub_topic_name = "${google_pubsub_topic.default-devicestatus.id}"

website/docs/r/cloudiot_registry.html.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ description: |-
66
Creates a device registry in Google's Cloud IoT Core platform
77
---
88

9-
# google\cloudiot\_registry
9+
# google\_cloudiot\_registry
1010

1111
Creates a device registry in Google's Cloud IoT Core platform. For more information see
1212
[the official documentation](https://cloud.google.com/iot/docs/) and
13-
[API](https://cloud.google.com/iot/docs/reference/rest/v1/projects.locations.registries).
13+
[API](https://cloud.google.com/iot/docs/reference/cloudiot/rest/v1/projects.locations.registries).
1414

1515

1616
## Example Usage

0 commit comments

Comments
 (0)