Google Cloud (GCP) Classic
Device
A Google Cloud IoT Core device.
To get more information about Device, see:
- API documentation
- How-to Guides
Example Usage
Cloudiot Device Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var registry = new Gcp.Iot.Registry("registry", new Gcp.Iot.RegistryArgs
{
});
var test_device = new Gcp.Iot.Device("test-device", new Gcp.Iot.DeviceArgs
{
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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
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.IO;
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var registry = new Gcp.Iot.Registry("registry", new Gcp.Iot.RegistryArgs
{
});
var test_device = new Gcp.Iot.Device("test-device", new Gcp.Iot.DeviceArgs
{
Registry = registry.Id,
Credentials =
{
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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
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("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 gcp from "@pulumi/gcp";
import * from "fs";
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",
},
});
Coming soon!
Create a 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<Device
Credential Args> The credentials used to authenticate this device. Structure is documented below.
- Gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- Log
Level string The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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
[]Device
Credential Args The credentials used to authenticate this device. Structure is documented below.
- Gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- Log
Level string The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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<Device
Credential Args> The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- log
Level String The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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
Device
Credential Args[] The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- log
Level string The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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[Device
Credential Args] The credentials used to authenticate this device. Structure is documented below.
- gateway_
config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- log_
level str The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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.
- gateway
Config Property Map Gateway-related configuration and state. Structure is documented below.
- log
Level String The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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<Device
Config> 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.
- Last
Config stringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- Last
Config stringSend Time The last time a cloud-to-device config version was sent to the device.
- Last
Error List<DeviceStatuses Last Error Status> The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- Last
Error stringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- Last
Event stringTime The last time a telemetry event was received.
- Last
Heartbeat stringTime The last time an MQTT PINGREQ was received.
- Last
State stringTime The last time a state event was received.
- Num
Id 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<Device
State> The state most recently received from the device.
- Configs
[]Device
Config 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.
- Last
Config stringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- Last
Config stringSend Time The last time a cloud-to-device config version was sent to the device.
- Last
Error []DeviceStatuses Last Error Status The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- Last
Error stringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- Last
Event stringTime The last time a telemetry event was received.
- Last
Heartbeat stringTime The last time an MQTT PINGREQ was received.
- Last
State stringTime The last time a state event was received.
- Num
Id 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
[]Device
State Type The state most recently received from the device.
- configs
List<Device
Config> 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.
- last
Config StringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- last
Config StringSend Time The last time a cloud-to-device config version was sent to the device.
- last
Error List<DeviceStatuses Last Error Status> The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last
Error StringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last
Event StringTime The last time a telemetry event was received.
- last
Heartbeat StringTime The last time an MQTT PINGREQ was received.
- last
State StringTime The last time a state event was received.
- num
Id 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<Device
State> The state most recently received from the device.
- configs
Device
Config[] 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.
- last
Config stringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- last
Config stringSend Time The last time a cloud-to-device config version was sent to the device.
- last
Error DeviceStatuses Last Error Status[] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last
Error stringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last
Event stringTime The last time a telemetry event was received.
- last
Heartbeat stringTime The last time an MQTT PINGREQ was received.
- last
State stringTime The last time a state event was received.
- num
Id 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
Device
State[] The state most recently received from the device.
- configs
Sequence[Device
Config] 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_ strack_ time The last time a cloud-to-device config version acknowledgment was received from the device.
- last_
config_ strsend_ time The last time a cloud-to-device config version was sent to the device.
- last_
error_ Sequence[Devicestatuses Last Error Status] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last_
error_ strtime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last_
event_ strtime The last time a telemetry event was received.
- last_
heartbeat_ strtime The last time an MQTT PINGREQ was received.
- last_
state_ strtime 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[Device
State] 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.
- last
Config StringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- last
Config StringSend Time The last time a cloud-to-device config version was sent to the device.
- last
Error List<Property Map>Statuses The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last
Error StringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last
Event StringTime The last time a telemetry event was received.
- last
Heartbeat StringTime The last time an MQTT PINGREQ was received.
- last
State StringTime The last time a state event was received.
- num
Id 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 an 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.
- Blocked bool
If a device is blocked, connections or requests from this device will fail.
- Configs
List<Device
Config Args> The most recent device configuration, which is eventually sent from Cloud IoT Core to the device.
- Credentials
List<Device
Credential Args> The credentials used to authenticate this device. Structure is documented below.
- Gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- Last
Config stringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- Last
Config stringSend Time The last time a cloud-to-device config version was sent to the device.
- Last
Error List<DeviceStatuses Last Error Status Args> The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- Last
Error stringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- Last
Event stringTime The last time a telemetry event was received.
- Last
Heartbeat stringTime The last time an MQTT PINGREQ was received.
- Last
State stringTime The last time a state event was received.
- Log
Level string The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- Metadata Dictionary<string, string>
The metadata key-value pairs assigned to the device.
- Name string
A unique name for the resource.
- Num
Id 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<Device
State Args> The state most recently received from the device.
- Blocked bool
If a device is blocked, connections or requests from this device will fail.
- Configs
[]Device
Config Args The most recent device configuration, which is eventually sent from Cloud IoT Core to the device.
- Credentials
[]Device
Credential Args The credentials used to authenticate this device. Structure is documented below.
- Gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- Last
Config stringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- Last
Config stringSend Time The last time a cloud-to-device config version was sent to the device.
- Last
Error []DeviceStatuses Last Error Status Args The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- Last
Error stringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- Last
Event stringTime The last time a telemetry event was received.
- Last
Heartbeat stringTime The last time an MQTT PINGREQ was received.
- Last
State stringTime The last time a state event was received.
- Log
Level string The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- Metadata map[string]string
The metadata key-value pairs assigned to the device.
- Name string
A unique name for the resource.
- Num
Id 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
[]Device
State Type Args 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<Device
Config Args> The most recent device configuration, which is eventually sent from Cloud IoT Core to the device.
- credentials
List<Device
Credential Args> The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- last
Config StringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- last
Config StringSend Time The last time a cloud-to-device config version was sent to the device.
- last
Error List<DeviceStatuses Last Error Status Args> The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last
Error StringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last
Event StringTime The last time a telemetry event was received.
- last
Heartbeat StringTime The last time an MQTT PINGREQ was received.
- last
State StringTime The last time a state event was received.
- log
Level String The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- metadata Map<String,String>
The metadata key-value pairs assigned to the device.
- name String
A unique name for the resource.
- num
Id 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<Device
State Args> The state most recently received from the device.
- blocked boolean
If a device is blocked, connections or requests from this device will fail.
- configs
Device
Config Args[] The most recent device configuration, which is eventually sent from Cloud IoT Core to the device.
- credentials
Device
Credential Args[] The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- last
Config stringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- last
Config stringSend Time The last time a cloud-to-device config version was sent to the device.
- last
Error DeviceStatuses Last Error Status Args[] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last
Error stringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last
Event stringTime The last time a telemetry event was received.
- last
Heartbeat stringTime The last time an MQTT PINGREQ was received.
- last
State stringTime The last time a state event was received.
- log
Level string The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- metadata {[key: string]: string}
The metadata key-value pairs assigned to the device.
- name string
A unique name for the resource.
- num
Id 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
Device
State Args[] 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[Device
Config Args] The most recent device configuration, which is eventually sent from Cloud IoT Core to the device.
- credentials
Sequence[Device
Credential Args] The credentials used to authenticate this device. Structure is documented below.
- gateway_
config DeviceGateway Config Args Gateway-related configuration and state. Structure is documented below.
- last_
config_ strack_ time The last time a cloud-to-device config version acknowledgment was received from the device.
- last_
config_ strsend_ time The last time a cloud-to-device config version was sent to the device.
- last_
error_ Sequence[Devicestatuses Last Error Status Args] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last_
error_ strtime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last_
event_ strtime The last time a telemetry event was received.
- last_
heartbeat_ strtime The last time an MQTT PINGREQ was received.
- last_
state_ strtime The last time a state event was received.
- log_
level str The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- 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[Device
State Args] 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.
- gateway
Config Property Map Gateway-related configuration and state. Structure is documented below.
- last
Config StringAck Time The last time a cloud-to-device config version acknowledgment was received from the device.
- last
Config StringSend Time The last time a cloud-to-device config version was sent to the device.
- last
Error List<Property Map>Statuses The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub.
- last
Error StringTime The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub.
- last
Event StringTime The last time a telemetry event was received.
- last
Heartbeat StringTime The last time an MQTT PINGREQ was received.
- last
State StringTime The last time a state event was received.
- log
Level String The logging verbosity for device activity. Possible values are
NONE
,ERROR
,INFO
, andDEBUG
.- metadata Map<String>
The metadata key-value pairs assigned to the device.
- name String
A unique name for the resource.
- num
Id 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
- Binary
Data string - Cloud
Update stringTime - Device
Ack stringTime - Version string
- Binary
Data string - Cloud
Update stringTime - Device
Ack stringTime - Version string
- binary
Data String - cloud
Update StringTime - device
Ack StringTime - version String
- binary
Data string - cloud
Update stringTime - device
Ack stringTime - version string
- binary_
data str - cloud_
update_ strtime - device_
ack_ strtime - version str
- binary
Data String - cloud
Update StringTime - device
Ack StringTime - version String
DeviceCredential
- Public
Key DeviceCredential Public Key A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.
- Expiration
Time string The time at which this credential becomes invalid.
- Public
Key DeviceCredential Public Key A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.
- Expiration
Time string The time at which this credential becomes invalid.
- public
Key DeviceCredential Public Key A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.
- expiration
Time String The time at which this credential becomes invalid.
- public
Key DeviceCredential Public Key A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.
- expiration
Time string The time at which this credential becomes invalid.
- public_
key DeviceCredential Public Key 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.
- public
Key Property Map A public key used to verify the signature of JSON Web Tokens (JWTs). Structure is documented below.
- expiration
Time String The time at which this credential becomes invalid.
DeviceCredentialPublicKey
DeviceGatewayConfig
- Gateway
Auth stringMethod Indicates whether the device is a gateway. Possible values are
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
, andASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- Gateway
Type string Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values areGATEWAY
andNON_GATEWAY
.- Last
Accessed stringGateway Id The ID of the gateway the device accessed most recently.
- Last
Accessed stringGateway Time The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
- Gateway
Auth stringMethod Indicates whether the device is a gateway. Possible values are
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
, andASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- Gateway
Type string Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values areGATEWAY
andNON_GATEWAY
.- Last
Accessed stringGateway Id The ID of the gateway the device accessed most recently.
- Last
Accessed stringGateway Time The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
- gateway
Auth StringMethod Indicates whether the device is a gateway. Possible values are
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
, andASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway
Type String Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values areGATEWAY
andNON_GATEWAY
.- last
Accessed StringGateway Id The ID of the gateway the device accessed most recently.
- last
Accessed StringGateway Time The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
- gateway
Auth stringMethod Indicates whether the device is a gateway. Possible values are
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
, andASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway
Type string Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values areGATEWAY
andNON_GATEWAY
.- last
Accessed stringGateway Id The ID of the gateway the device accessed most recently.
- last
Accessed stringGateway Time The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
- gateway_
auth_ strmethod Indicates whether the device is a gateway. Possible values are
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
, andASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway_
type str Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values areGATEWAY
andNON_GATEWAY
.- last_
accessed_ strgateway_ id The ID of the gateway the device accessed most recently.
- last_
accessed_ strgateway_ time The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
- gateway
Auth StringMethod Indicates whether the device is a gateway. Possible values are
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
, andASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway
Type String Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values areGATEWAY
andNON_GATEWAY
.- last
Accessed StringGateway Id The ID of the gateway the device accessed most recently.
- last
Accessed StringGateway Time The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
DeviceLastErrorStatus
DeviceState
- Binary
Data string - Update
Time string
- Binary
Data string - Update
Time string
- binary
Data String - update
Time String
- binary
Data string - update
Time string
- binary_
data str - update_
time str
- binary
Data String - update
Time 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.