Device

A Google Cloud IoT Core device.

To get more information about Device, see:

Example Usage

Cloudiot Device Basic

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var registry = new Gcp.Iot.Registry("registry");

    var test_device = new Gcp.Iot.Device("test-device", new()
    {
        Registry = registry.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		registry, err := iot.NewRegistry(ctx, "registry", nil)
		if err != nil {
			return err
		}
		_, err = iot.NewDevice(ctx, "test-device", &iot.DeviceArgs{
			Registry: registry.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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());

    }
}
import pulumi
import pulumi_gcp as gcp

registry = gcp.iot.Registry("registry")
test_device = gcp.iot.Device("test-device", registry=registry.id)
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const registry = new gcp.iot.Registry("registry", {});
const test_device = new gcp.iot.Device("test-device", {registry: registry.id});
resources:
  registry:
    type: gcp:iot:Registry
  test-device:
    type: gcp:iot:Device
    properties:
      registry: ${registry.id}

Cloudiot Device Full

using System.Collections.Generic;
using System.IO;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var registry = new Gcp.Iot.Registry("registry");

    var test_device = new Gcp.Iot.Device("test-device", new()
    {
        Registry = registry.Id,
        Credentials = new[]
        {
            new Gcp.Iot.Inputs.DeviceCredentialArgs
            {
                PublicKey = new Gcp.Iot.Inputs.DeviceCredentialPublicKeyArgs
                {
                    Format = "RSA_PEM",
                    Key = File.ReadAllText("test-fixtures/rsa_public.pem"),
                },
            },
        },
        Blocked = false,
        LogLevel = "INFO",
        Metadata = 
        {
            { "test_key_1", "test_value_1" },
        },
        GatewayConfig = new Gcp.Iot.Inputs.DeviceGatewayConfigArgs
        {
            GatewayType = "NON_GATEWAY",
        },
    });

});
package main

import (
	"io/ioutil"

	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		registry, err := iot.NewRegistry(ctx, "registry", nil)
		if err != nil {
			return err
		}
		_, err = iot.NewDevice(ctx, "test-device", &iot.DeviceArgs{
			Registry: registry.ID(),
			Credentials: iot.DeviceCredentialArray{
				&iot.DeviceCredentialArgs{
					PublicKey: &iot.DeviceCredentialPublicKeyArgs{
						Format: pulumi.String("RSA_PEM"),
						Key:    readFileOrPanic("test-fixtures/rsa_public.pem"),
					},
				},
			},
			Blocked:  pulumi.Bool(false),
			LogLevel: pulumi.String("INFO"),
			Metadata: pulumi.StringMap{
				"test_key_1": pulumi.String("test_value_1"),
			},
			GatewayConfig: &iot.DeviceGatewayConfigArgs{
				GatewayType: pulumi.String("NON_GATEWAY"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 pulumi
import pulumi_gcp as gcp

registry = gcp.iot.Registry("registry")
test_device = gcp.iot.Device("test-device",
    registry=registry.id,
    credentials=[gcp.iot.DeviceCredentialArgs(
        public_key=gcp.iot.DeviceCredentialPublicKeyArgs(
            format="RSA_PEM",
            key=(lambda path: open(path).read())("test-fixtures/rsa_public.pem"),
        ),
    )],
    blocked=False,
    log_level="INFO",
    metadata={
        "test_key_1": "test_value_1",
    },
    gateway_config=gcp.iot.DeviceGatewayConfigArgs(
        gateway_type="NON_GATEWAY",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";

const registry = new gcp.iot.Registry("registry", {});
const test_device = new gcp.iot.Device("test-device", {
    registry: registry.id,
    credentials: [{
        publicKey: {
            format: "RSA_PEM",
            key: fs.readFileSync("test-fixtures/rsa_public.pem"),
        },
    }],
    blocked: false,
    logLevel: "INFO",
    metadata: {
        test_key_1: "test_value_1",
    },
    gatewayConfig: {
        gatewayType: "NON_GATEWAY",
    },
});
resources:
  registry:
    type: gcp:iot:Registry
  test-device:
    type: gcp:iot:Device
    properties:
      registry: ${registry.id}
      credentials:
        - publicKey:
            format: RSA_PEM
            key:
              fn::readFile: test-fixtures/rsa_public.pem
      blocked: false
      logLevel: INFO
      metadata:
        test_key_1: test_value_1
      gatewayConfig:
        gatewayType: NON_GATEWAY

Create Device Resource

new Device(name: string, args: DeviceArgs, opts?: CustomResourceOptions);
@overload
def Device(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           blocked: Optional[bool] = None,
           credentials: Optional[Sequence[DeviceCredentialArgs]] = None,
           gateway_config: Optional[DeviceGatewayConfigArgs] = None,
           log_level: Optional[str] = None,
           metadata: Optional[Mapping[str, str]] = None,
           name: Optional[str] = None,
           registry: Optional[str] = None)
@overload
def Device(resource_name: str,
           args: DeviceArgs,
           opts: Optional[ResourceOptions] = None)
func NewDevice(ctx *Context, name string, args DeviceArgs, opts ...ResourceOption) (*Device, error)
public Device(string name, DeviceArgs args, CustomResourceOptions? opts = null)
public Device(String name, DeviceArgs args)
public Device(String name, DeviceArgs args, CustomResourceOptions options)
type: gcp:iot:Device
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DeviceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DeviceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DeviceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DeviceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DeviceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Device Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Device resource accepts the following input properties:

Registry string

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

Blocked bool

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

Credentials List<DeviceCredentialArgs>

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

GatewayConfig DeviceGatewayConfigArgs

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

LogLevel string

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

Metadata Dictionary<string, string>

The metadata key-value pairs assigned to the device.

Name string

A unique name for the resource.

Registry string

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

Blocked bool

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

Credentials []DeviceCredentialArgs

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

GatewayConfig DeviceGatewayConfigArgs

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

LogLevel string

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

Metadata map[string]string

The metadata key-value pairs assigned to the device.

Name string

A unique name for the resource.

registry String

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

blocked Boolean

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

credentials List<DeviceCredentialArgs>

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

gatewayConfig DeviceGatewayConfigArgs

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

logLevel String

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

metadata Map<String,String>

The metadata key-value pairs assigned to the device.

name String

A unique name for the resource.

registry string

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

blocked boolean

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

credentials DeviceCredentialArgs[]

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

gatewayConfig DeviceGatewayConfigArgs

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

logLevel string

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

metadata {[key: string]: string}

The metadata key-value pairs assigned to the device.

name string

A unique name for the resource.

registry str

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

blocked bool

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

credentials Sequence[DeviceCredentialArgs]

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

gateway_config DeviceGatewayConfigArgs

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

log_level str

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

metadata Mapping[str, str]

The metadata key-value pairs assigned to the device.

name str

A unique name for the resource.

registry String

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

blocked Boolean

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

credentials List<Property Map>

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

gatewayConfig Property Map

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

logLevel String

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

metadata Map<String>

The metadata key-value pairs assigned to the device.

name String

A unique name for the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Device resource produces the following output properties:

Configs List<DeviceConfig>

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

Id string

The provider-assigned unique ID for this managed resource.

LastConfigAckTime string

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

LastConfigSendTime string

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

LastErrorStatuses List<DeviceLastErrorStatus>

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

LastErrorTime string

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

LastEventTime string

The last time a telemetry event was received.

LastHeartbeatTime string

The last time an MQTT PINGREQ was received.

LastStateTime string

The last time a state event was received.

NumId string

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

States List<DeviceState>

The state most recently received from the device.

Configs []DeviceConfig

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

Id string

The provider-assigned unique ID for this managed resource.

LastConfigAckTime string

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

LastConfigSendTime string

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

LastErrorStatuses []DeviceLastErrorStatus

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

LastErrorTime string

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

LastEventTime string

The last time a telemetry event was received.

LastHeartbeatTime string

The last time an MQTT PINGREQ was received.

LastStateTime string

The last time a state event was received.

NumId string

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

States []DeviceStateType

The state most recently received from the device.

configs List<DeviceConfig>

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

id String

The provider-assigned unique ID for this managed resource.

lastConfigAckTime String

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

lastConfigSendTime String

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

lastErrorStatuses List<DeviceLastErrorStatus>

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

lastErrorTime String

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

lastEventTime String

The last time a telemetry event was received.

lastHeartbeatTime String

The last time an MQTT PINGREQ was received.

lastStateTime String

The last time a state event was received.

numId String

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

states List<DeviceState>

The state most recently received from the device.

configs DeviceConfig[]

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

id string

The provider-assigned unique ID for this managed resource.

lastConfigAckTime string

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

lastConfigSendTime string

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

lastErrorStatuses DeviceLastErrorStatus[]

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

lastErrorTime string

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

lastEventTime string

The last time a telemetry event was received.

lastHeartbeatTime string

The last time an MQTT PINGREQ was received.

lastStateTime string

The last time a state event was received.

numId string

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

states DeviceState[]

The state most recently received from the device.

configs Sequence[DeviceConfig]

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

id str

The provider-assigned unique ID for this managed resource.

last_config_ack_time str

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

last_config_send_time str

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

last_error_statuses Sequence[DeviceLastErrorStatus]

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

last_error_time str

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

last_event_time str

The last time a telemetry event was received.

last_heartbeat_time str

The last time an MQTT PINGREQ was received.

last_state_time str

The last time a state event was received.

num_id str

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

states Sequence[DeviceState]

The state most recently received from the device.

configs List<Property Map>

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

id String

The provider-assigned unique ID for this managed resource.

lastConfigAckTime String

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

lastConfigSendTime String

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

lastErrorStatuses List<Property Map>

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

lastErrorTime String

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

lastEventTime String

The last time a telemetry event was received.

lastHeartbeatTime String

The last time an MQTT PINGREQ was received.

lastStateTime String

The last time a state event was received.

numId String

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

states List<Property Map>

The state most recently received from the device.

Look up Existing Device Resource

Get an existing Device resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DeviceState, opts?: CustomResourceOptions): Device
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        blocked: Optional[bool] = None,
        configs: Optional[Sequence[DeviceConfigArgs]] = None,
        credentials: Optional[Sequence[DeviceCredentialArgs]] = None,
        gateway_config: Optional[DeviceGatewayConfigArgs] = None,
        last_config_ack_time: Optional[str] = None,
        last_config_send_time: Optional[str] = None,
        last_error_statuses: Optional[Sequence[DeviceLastErrorStatusArgs]] = None,
        last_error_time: Optional[str] = None,
        last_event_time: Optional[str] = None,
        last_heartbeat_time: Optional[str] = None,
        last_state_time: Optional[str] = None,
        log_level: Optional[str] = None,
        metadata: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        num_id: Optional[str] = None,
        registry: Optional[str] = None,
        states: Optional[Sequence[DeviceStateArgs]] = None) -> Device
func GetDevice(ctx *Context, name string, id IDInput, state *DeviceState, opts ...ResourceOption) (*Device, error)
public static Device Get(string name, Input<string> id, DeviceState? state, CustomResourceOptions? opts = null)
public static Device get(String name, Output<String> id, DeviceState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Blocked bool

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

Configs List<DeviceConfigArgs>

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

Credentials List<DeviceCredentialArgs>

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

GatewayConfig DeviceGatewayConfigArgs

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

LastConfigAckTime string

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

LastConfigSendTime string

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

LastErrorStatuses List<DeviceLastErrorStatusArgs>

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

LastErrorTime string

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

LastEventTime string

The last time a telemetry event was received.

LastHeartbeatTime string

The last time an MQTT PINGREQ was received.

LastStateTime string

The last time a state event was received.

LogLevel string

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

Metadata Dictionary<string, string>

The metadata key-value pairs assigned to the device.

Name string

A unique name for the resource.

NumId string

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

Registry string

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

States List<DeviceStateArgs>

The state most recently received from the device.

Blocked bool

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

Configs []DeviceConfigArgs

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

Credentials []DeviceCredentialArgs

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

GatewayConfig DeviceGatewayConfigArgs

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

LastConfigAckTime string

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

LastConfigSendTime string

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

LastErrorStatuses []DeviceLastErrorStatusArgs

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

LastErrorTime string

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

LastEventTime string

The last time a telemetry event was received.

LastHeartbeatTime string

The last time an MQTT PINGREQ was received.

LastStateTime string

The last time a state event was received.

LogLevel string

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

Metadata map[string]string

The metadata key-value pairs assigned to the device.

Name string

A unique name for the resource.

NumId string

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

Registry string

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

States []DeviceStateTypeArgs

The state most recently received from the device.

blocked Boolean

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

configs List<DeviceConfigArgs>

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

credentials List<DeviceCredentialArgs>

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

gatewayConfig DeviceGatewayConfigArgs

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

lastConfigAckTime String

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

lastConfigSendTime String

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

lastErrorStatuses List<DeviceLastErrorStatusArgs>

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

lastErrorTime String

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

lastEventTime String

The last time a telemetry event was received.

lastHeartbeatTime String

The last time an MQTT PINGREQ was received.

lastStateTime String

The last time a state event was received.

logLevel String

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

metadata Map<String,String>

The metadata key-value pairs assigned to the device.

name String

A unique name for the resource.

numId String

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

registry String

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

states List<DeviceStateArgs>

The state most recently received from the device.

blocked boolean

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

configs DeviceConfigArgs[]

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

credentials DeviceCredentialArgs[]

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

gatewayConfig DeviceGatewayConfigArgs

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

lastConfigAckTime string

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

lastConfigSendTime string

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

lastErrorStatuses DeviceLastErrorStatusArgs[]

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

lastErrorTime string

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

lastEventTime string

The last time a telemetry event was received.

lastHeartbeatTime string

The last time an MQTT PINGREQ was received.

lastStateTime string

The last time a state event was received.

logLevel string

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

metadata {[key: string]: string}

The metadata key-value pairs assigned to the device.

name string

A unique name for the resource.

numId string

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

registry string

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

states DeviceStateArgs[]

The state most recently received from the device.

blocked bool

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

configs Sequence[DeviceConfigArgs]

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

credentials Sequence[DeviceCredentialArgs]

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

gateway_config DeviceGatewayConfigArgs

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

last_config_ack_time str

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

last_config_send_time str

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

last_error_statuses Sequence[DeviceLastErrorStatusArgs]

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

last_error_time str

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

last_event_time str

The last time a telemetry event was received.

last_heartbeat_time str

The last time an MQTT PINGREQ was received.

last_state_time str

The last time a state event was received.

log_level str

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

metadata Mapping[str, str]

The metadata key-value pairs assigned to the device.

name str

A unique name for the resource.

num_id str

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

registry str

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

states Sequence[DeviceStateArgs]

The state most recently received from the device.

blocked Boolean

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

configs List<Property Map>

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

credentials List<Property Map>

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

gatewayConfig Property Map

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

lastConfigAckTime String

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

lastConfigSendTime String

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

lastErrorStatuses List<Property Map>

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

lastErrorTime String

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

lastEventTime String

The last time a telemetry event was received.

lastHeartbeatTime String

The last time an MQTT PINGREQ was received.

lastStateTime String

The last time a state event was received.

logLevel String

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

metadata Map<String>

The metadata key-value pairs assigned to the device.

name String

A unique name for the resource.

numId String

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

registry String

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

states List<Property Map>

The state most recently received from the device.

Supporting Types

DeviceConfig

DeviceCredential

PublicKey DeviceCredentialPublicKey

A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.

ExpirationTime string

The time at which this credential becomes invalid.

PublicKey DeviceCredentialPublicKey

A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.

ExpirationTime string

The time at which this credential becomes invalid.

publicKey DeviceCredentialPublicKey

A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.

expirationTime String

The time at which this credential becomes invalid.

publicKey DeviceCredentialPublicKey

A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.

expirationTime string

The time at which this credential becomes invalid.

public_key DeviceCredentialPublicKey

A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.

expiration_time str

The time at which this credential becomes invalid.

publicKey Property Map

A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.

expirationTime String

The time at which this credential becomes invalid.

DeviceCredentialPublicKey

Format string

The format of the key. Possible values are RSA_PEM, RSA_X509_PEM, ES256_PEM, and ES256_X509_PEM.

Key string

The key data.

Format string

The format of the key. Possible values are RSA_PEM, RSA_X509_PEM, ES256_PEM, and ES256_X509_PEM.

Key string

The key data.

format String

The format of the key. Possible values are RSA_PEM, RSA_X509_PEM, ES256_PEM, and ES256_X509_PEM.

key String

The key data.

format string

The format of the key. Possible values are RSA_PEM, RSA_X509_PEM, ES256_PEM, and ES256_X509_PEM.

key string

The key data.

format str

The format of the key. Possible values are RSA_PEM, RSA_X509_PEM, ES256_PEM, and ES256_X509_PEM.

key str

The key data.

format String

The format of the key. Possible values are RSA_PEM, RSA_X509_PEM, ES256_PEM, and ES256_X509_PEM.

key String

The key data.

DeviceGatewayConfig

GatewayAuthMethod string

Indicates whether the device is a gateway. Possible values are ASSOCIATION_ONLY, DEVICE_AUTH_TOKEN_ONLY, and ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

GatewayType string

Indicates whether the device is a gateway. Default value is NON_GATEWAY. Possible values are GATEWAY and NON_GATEWAY.

LastAccessedGatewayId string

The ID of the gateway the device accessed most recently.

LastAccessedGatewayTime string

The most recent time at which the device accessed the gateway specified in last_accessed_gateway.

GatewayAuthMethod string

Indicates whether the device is a gateway. Possible values are ASSOCIATION_ONLY, DEVICE_AUTH_TOKEN_ONLY, and ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

GatewayType string

Indicates whether the device is a gateway. Default value is NON_GATEWAY. Possible values are GATEWAY and NON_GATEWAY.

LastAccessedGatewayId string

The ID of the gateway the device accessed most recently.

LastAccessedGatewayTime string

The most recent time at which the device accessed the gateway specified in last_accessed_gateway.

gatewayAuthMethod String

Indicates whether the device is a gateway. Possible values are ASSOCIATION_ONLY, DEVICE_AUTH_TOKEN_ONLY, and ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

gatewayType String

Indicates whether the device is a gateway. Default value is NON_GATEWAY. Possible values are GATEWAY and NON_GATEWAY.

lastAccessedGatewayId String

The ID of the gateway the device accessed most recently.

lastAccessedGatewayTime String

The most recent time at which the device accessed the gateway specified in last_accessed_gateway.

gatewayAuthMethod string

Indicates whether the device is a gateway. Possible values are ASSOCIATION_ONLY, DEVICE_AUTH_TOKEN_ONLY, and ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

gatewayType string

Indicates whether the device is a gateway. Default value is NON_GATEWAY. Possible values are GATEWAY and NON_GATEWAY.

lastAccessedGatewayId string

The ID of the gateway the device accessed most recently.

lastAccessedGatewayTime string

The most recent time at which the device accessed the gateway specified in last_accessed_gateway.

gateway_auth_method str

Indicates whether the device is a gateway. Possible values are ASSOCIATION_ONLY, DEVICE_AUTH_TOKEN_ONLY, and ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

gateway_type str

Indicates whether the device is a gateway. Default value is NON_GATEWAY. Possible values are GATEWAY and NON_GATEWAY.

last_accessed_gateway_id str

The ID of the gateway the device accessed most recently.

last_accessed_gateway_time str

The most recent time at which the device accessed the gateway specified in last_accessed_gateway.

gatewayAuthMethod String

Indicates whether the device is a gateway. Possible values are ASSOCIATION_ONLY, DEVICE_AUTH_TOKEN_ONLY, and ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

gatewayType String

Indicates whether the device is a gateway. Default value is NON_GATEWAY. Possible values are GATEWAY and NON_GATEWAY.

lastAccessedGatewayId String

The ID of the gateway the device accessed most recently.

lastAccessedGatewayTime String

The most recent time at which the device accessed the gateway specified in last_accessed_gateway.

DeviceLastErrorStatus

Details List<ImmutableDictionary<string, object>>
Message string
Number int
Details []map[string]interface{}
Message string
Number int
details List<Map<String,Object>>
message String
number Integer
details {[key: string]: any}[]
message string
number number
details Sequence[Mapping[str, Any]]
message str
number int
details List<Map<Any>>
message String
number Number

DeviceState

BinaryData string
UpdateTime string
BinaryData string
UpdateTime string
binaryData String
updateTime String
binaryData string
updateTime string
binaryData String
updateTime String

Import

Device can be imported using any of these accepted formats

 $ pulumi import gcp:iot/device:Device default {{registry}}/devices/{{name}}

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.