Device

class Device : KotlinCustomResource

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:

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

Link copied to clipboard
val blocked: Output<Boolean>?

If a device is blocked, connections or requests from this device will fail.

Link copied to clipboard
val configs: Output<List<DeviceConfig>>

The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.

Link copied to clipboard

The credentials used to authenticate this device. Structure is documented below.

Link copied to clipboard

Gateway-related configuration and state. Structure is documented below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The last time a cloud-to-device config version acknowledgment was received from the device.

Link copied to clipboard

The last time a cloud-to-device config version was sent to the device.

Link copied to clipboard

The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. Structure is documented below.

Link copied to clipboard
val lastErrorTime: Output<String>

The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.

Link copied to clipboard
val lastEventTime: Output<String>

The last time a telemetry event was received.

Link copied to clipboard

The last time an MQTT PINGREQ was received.

Link copied to clipboard
val lastStateTime: Output<String>

The last time a state event was received.

Link copied to clipboard
val logLevel: Output<String>?

The logging verbosity for device activity. Possible values are: NONE, ERROR, INFO, DEBUG.

Link copied to clipboard
val metadata: Output<Map<String, String>>?

The metadata key-value pairs assigned to the device.

Link copied to clipboard
val name: Output<String>

A unique name for the resource.

Link copied to clipboard
val numId: Output<String>

A server-defined unique numeric ID for the device. This is a more compact way to identify devices, and it is globally unique.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val registry: Output<String>

The name of the device registry where this device should be created.

Link copied to clipboard
val states: Output<List<DeviceState>>

The state most recently received from the device. Structure is documented below.

Link copied to clipboard
val urn: Output<String>