Device
Warning:
gcp.iot.Device
is deprecated in the API. This resource will be removed in the next major release of the provider. A Google Cloud IoT Core device. To get more information about Device, see:
How-to Guides
Example Usage
Cloudiot Device Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iot.Registry;
import com.pulumi.gcp.iot.Device;
import com.pulumi.gcp.iot.DeviceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var registry = new Registry("registry");
var test_device = new Device("test-device", DeviceArgs.builder()
.registry(registry.id())
.build());
}
}
Cloudiot Device Full
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iot.Registry;
import com.pulumi.gcp.iot.Device;
import com.pulumi.gcp.iot.DeviceArgs;
import com.pulumi.gcp.iot.inputs.DeviceCredentialArgs;
import com.pulumi.gcp.iot.inputs.DeviceCredentialPublicKeyArgs;
import com.pulumi.gcp.iot.inputs.DeviceGatewayConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var registry = new Registry("registry");
var test_device = new Device("test-device", DeviceArgs.builder()
.registry(registry.id())
.credentials(DeviceCredentialArgs.builder()
.publicKey(DeviceCredentialPublicKeyArgs.builder()
.format("RSA_PEM")
.key(Files.readString(Paths.get("test-fixtures/rsa_public.pem")))
.build())
.build())
.blocked(false)
.logLevel("INFO")
.metadata(Map.of("test_key_1", "test_value_1"))
.gatewayConfig(DeviceGatewayConfigArgs.builder()
.gatewayType("NON_GATEWAY")
.build())
.build());
}
}
Import
Device can be imported using any of these accepted formats:
$ pulumi import gcp:iot/device:Device default {{registry}}/devices/{{name}}
Properties
The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.
The credentials used to authenticate this device. Structure is documented below.
Gateway-related configuration and state. Structure is documented below.
The last time a cloud-to-device config version acknowledgment was received from the device.
The last time a cloud-to-device config version was sent to the device.
The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. Structure is documented below.
The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
The last time a telemetry event was received.
The last time an MQTT PINGREQ was received.
The last time a state event was received.
The state most recently received from the device. Structure is documented below.