1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. iot
  5. Device
Google Cloud Classic v6.66.0 published on Monday, Sep 18, 2023 by Pulumi

gcp.iot.Device

Explore with Pulumi AI

gcp logo
Google Cloud Classic v6.66.0 published on Monday, Sep 18, 2023 by Pulumi

    A Google Cloud IoT Core device.

    To get more information about Device, see:

    Example Usage

    Cloudiot Device Basic

    using System.Collections.Generic;
    using System.Linq;
    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 System.Linq;
    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 (
    	"os"
    
    	"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 := os.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<DeviceCredential>

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

    GatewayConfig DeviceGatewayConfig

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

    LogLevel string

    The logging verbosity for device activity. Possible values are: NONE, ERROR, INFO, 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, 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<DeviceCredential>

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

    gatewayConfig DeviceGatewayConfig

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

    logLevel String

    The logging verbosity for device activity. Possible values are: NONE, ERROR, INFO, 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 DeviceCredential[]

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

    gatewayConfig DeviceGatewayConfig

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

    logLevel string

    The logging verbosity for device activity. Possible values are: NONE, ERROR, INFO, 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, 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, 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. Structure is documented below.

    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. Structure is documented below.

    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. Structure is documented below.

    Configs []DeviceConfig

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

    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. Structure is documented below.

    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. Structure is documented below.

    configs List<DeviceConfig>

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

    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. Structure is documented below.

    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. Structure is documented below.

    configs DeviceConfig[]

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

    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. Structure is documented below.

    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. Structure is documented below.

    configs Sequence[DeviceConfig]

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

    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. Structure is documented below.

    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. Structure is documented below.

    configs List<Property Map>

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

    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. Structure is documented below.

    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. Structure is documented below.

    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<DeviceConfig>

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

    Credentials List<DeviceCredential>

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

    GatewayConfig DeviceGatewayConfig

    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<DeviceLastErrorStatus>

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

    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, 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<DeviceState>

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

    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. Structure is documented below.

    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. Structure is documented below.

    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, 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. Structure is documented below.

    blocked Boolean

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

    configs List<DeviceConfig>

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

    credentials List<DeviceCredential>

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

    gatewayConfig DeviceGatewayConfig

    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<DeviceLastErrorStatus>

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

    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, 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<DeviceState>

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

    blocked boolean

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

    configs DeviceConfig[]

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

    credentials DeviceCredential[]

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

    gatewayConfig DeviceGatewayConfig

    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 DeviceLastErrorStatus[]

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

    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, 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 DeviceState[]

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

    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. Structure is documented below.

    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. Structure is documented below.

    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, 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. Structure is documented below.

    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. Structure is documented below.

    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. Structure is documented below.

    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, 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. Structure is documented below.

    Supporting Types

    DeviceConfig, DeviceConfigArgs

    BinaryData string

    The device state data.

    CloudUpdateTime string

    (Output) The time at which this configuration version was updated in Cloud IoT Core.

    DeviceAckTime string

    (Output) The time at which Cloud IoT Core received the acknowledgment from the device, indicating that the device has received this configuration version.

    Version string

    (Output) The version of this update.

    BinaryData string

    The device state data.

    CloudUpdateTime string

    (Output) The time at which this configuration version was updated in Cloud IoT Core.

    DeviceAckTime string

    (Output) The time at which Cloud IoT Core received the acknowledgment from the device, indicating that the device has received this configuration version.

    Version string

    (Output) The version of this update.

    binaryData String

    The device state data.

    cloudUpdateTime String

    (Output) The time at which this configuration version was updated in Cloud IoT Core.

    deviceAckTime String

    (Output) The time at which Cloud IoT Core received the acknowledgment from the device, indicating that the device has received this configuration version.

    version String

    (Output) The version of this update.

    binaryData string

    The device state data.

    cloudUpdateTime string

    (Output) The time at which this configuration version was updated in Cloud IoT Core.

    deviceAckTime string

    (Output) The time at which Cloud IoT Core received the acknowledgment from the device, indicating that the device has received this configuration version.

    version string

    (Output) The version of this update.

    binary_data str

    The device state data.

    cloud_update_time str

    (Output) The time at which this configuration version was updated in Cloud IoT Core.

    device_ack_time str

    (Output) The time at which Cloud IoT Core received the acknowledgment from the device, indicating that the device has received this configuration version.

    version str

    (Output) The version of this update.

    binaryData String

    The device state data.

    cloudUpdateTime String

    (Output) The time at which this configuration version was updated in Cloud IoT Core.

    deviceAckTime String

    (Output) The time at which Cloud IoT Core received the acknowledgment from the device, indicating that the device has received this configuration version.

    version String

    (Output) The version of this update.

    DeviceCredential, DeviceCredentialArgs

    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, DeviceCredentialPublicKeyArgs

    Format string

    The format of the key. Possible values are: RSA_PEM, RSA_X509_PEM, ES256_PEM, 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, 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, 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, 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, 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, ES256_X509_PEM.

    key String

    The key data.

    DeviceGatewayConfig, DeviceGatewayConfigArgs

    GatewayAuthMethod string

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

    GatewayType string

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

    LastAccessedGatewayId string

    (Output) The ID of the gateway the device accessed most recently.

    LastAccessedGatewayTime string

    (Output) 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, ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

    GatewayType string

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

    LastAccessedGatewayId string

    (Output) The ID of the gateway the device accessed most recently.

    LastAccessedGatewayTime string

    (Output) 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, ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

    gatewayType String

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

    lastAccessedGatewayId String

    (Output) The ID of the gateway the device accessed most recently.

    lastAccessedGatewayTime String

    (Output) 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, ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

    gatewayType string

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

    lastAccessedGatewayId string

    (Output) The ID of the gateway the device accessed most recently.

    lastAccessedGatewayTime string

    (Output) 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, ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

    gateway_type str

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

    last_accessed_gateway_id str

    (Output) The ID of the gateway the device accessed most recently.

    last_accessed_gateway_time str

    (Output) 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, ASSOCIATION_AND_DEVICE_AUTH_TOKEN.

    gatewayType String

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

    lastAccessedGatewayId String

    (Output) The ID of the gateway the device accessed most recently.

    lastAccessedGatewayTime String

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

    DeviceLastErrorStatus, DeviceLastErrorStatusArgs

    Details List<ImmutableDictionary<string, object>>

    A list of messages that carry the error details.

    Message string

    A developer-facing error message, which should be in English.

    Number int

    The status code, which should be an enum value of google.rpc.Code.

    Details []map[string]interface{}

    A list of messages that carry the error details.

    Message string

    A developer-facing error message, which should be in English.

    Number int

    The status code, which should be an enum value of google.rpc.Code.

    details List<Map<String,Object>>

    A list of messages that carry the error details.

    message String

    A developer-facing error message, which should be in English.

    number Integer

    The status code, which should be an enum value of google.rpc.Code.

    details {[key: string]: any}[]

    A list of messages that carry the error details.

    message string

    A developer-facing error message, which should be in English.

    number number

    The status code, which should be an enum value of google.rpc.Code.

    details Sequence[Mapping[str, Any]]

    A list of messages that carry the error details.

    message str

    A developer-facing error message, which should be in English.

    number int

    The status code, which should be an enum value of google.rpc.Code.

    details List<Map<Any>>

    A list of messages that carry the error details.

    message String

    A developer-facing error message, which should be in English.

    number Number

    The status code, which should be an enum value of google.rpc.Code.

    DeviceState, DeviceStateArgs

    BinaryData string

    The device state data.

    UpdateTime string

    The time at which this state version was updated in Cloud IoT Core.

    BinaryData string

    The device state data.

    UpdateTime string

    The time at which this state version was updated in Cloud IoT Core.

    binaryData String

    The device state data.

    updateTime String

    The time at which this state version was updated in Cloud IoT Core.

    binaryData string

    The device state data.

    updateTime string

    The time at which this state version was updated in Cloud IoT Core.

    binary_data str

    The device state data.

    update_time str

    The time at which this state version was updated in Cloud IoT Core.

    binaryData String

    The device state data.

    updateTime String

    The time at which this state version was updated in Cloud IoT Core.

    Import

    Device can be imported using any of these accepted formats:

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

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes

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

    gcp logo
    Google Cloud Classic v6.66.0 published on Monday, Sep 18, 2023 by Pulumi