gcp.iot.Device
Explore with Pulumi AI
A Google Cloud IoT Core device.
To get more information about Device, see:
- API documentation
- How-to Guides
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<Device
Credential> The credentials used to authenticate this device. Structure is documented below.
- Gateway
Config DeviceGateway Config Gateway-related configuration and state. Structure is documented below.
- Log
Level 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
[]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
,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<Device
Credential> The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config Gateway-related configuration and state. Structure is documented below.
- log
Level 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
Device
Credential[] The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config Gateway-related configuration and state. Structure is documented below.
- log
Level 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[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
,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.
- 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
,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<Device
Config> 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.
- 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. Structure is documented below.
- 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. Structure is documented below.
- Configs
[]Device
Config 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.
- 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. Structure is documented below.
- 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. Structure is documented below.
- configs
List<Device
Config> 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.
- 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. Structure is documented below.
- 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. Structure is documented below.
- configs
Device
Config[] 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.
- 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. Structure is documented below.
- 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. Structure is documented below.
- configs
Sequence[Device
Config] 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_ 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. Structure is documented below.
- 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. 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.
- 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. Structure is documented below.
- 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. 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.
- Blocked bool
If a device is blocked, connections or requests from this device will fail.
- Configs
List<Device
Config> The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.
- Credentials
List<Device
Credential> The credentials used to authenticate this device. Structure is documented below.
- Gateway
Config DeviceGateway Config 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> The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. Structure is documented below.
- 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
,DEBUG
.- 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> 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
[]Device
Config Args The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.
- 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. Structure is documented below.
- 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
,DEBUG
.- 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. Structure is documented below.
- blocked Boolean
If a device is blocked, connections or requests from this device will fail.
- configs
List<Device
Config> The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.
- credentials
List<Device
Credential> The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config 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> The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. Structure is documented below.
- 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
,DEBUG
.- 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> 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
Device
Config[] The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.
- credentials
Device
Credential[] The credentials used to authenticate this device. Structure is documented below.
- gateway
Config DeviceGateway Config 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[] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. Structure is documented below.
- 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
,DEBUG
.- 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[] 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[Device
Config Args] The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. Structure is documented below.
- 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. Structure is documented below.
- 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
,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[Device
State Args] 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.
- 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. Structure is documented below.
- 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
,DEBUG
.- 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. Structure is documented below.
Supporting Types
DeviceConfig, DeviceConfigArgs
- Binary
Data string The device state data.
- Cloud
Update stringTime (Output) The time at which this configuration version was updated in Cloud IoT Core.
- Device
Ack stringTime (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 string The device state data.
- Cloud
Update stringTime (Output) The time at which this configuration version was updated in Cloud IoT Core.
- Device
Ack stringTime (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 String The device state data.
- cloud
Update StringTime (Output) The time at which this configuration version was updated in Cloud IoT Core.
- device
Ack StringTime (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 string The device state data.
- cloud
Update stringTime (Output) The time at which this configuration version was updated in Cloud IoT Core.
- device
Ack stringTime (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_ strtime (Output) The time at which this configuration version was updated in Cloud IoT Core.
- device_
ack_ strtime (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.
- binary
Data String The device state data.
- cloud
Update StringTime (Output) The time at which this configuration version was updated in Cloud IoT Core.
- device
Ack StringTime (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
- 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, DeviceCredentialPublicKeyArgs
DeviceGatewayConfig, DeviceGatewayConfigArgs
- Gateway
Auth stringMethod Indicates whether the device is a gateway. Possible values are:
ASSOCIATION_ONLY
,DEVICE_AUTH_TOKEN_ONLY
,ASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- Gateway
Type string Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values are:GATEWAY
,NON_GATEWAY
.- Last
Accessed stringGateway Id (Output) The ID of the gateway the device accessed most recently.
- Last
Accessed stringGateway Time (Output) 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
,ASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- Gateway
Type string Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values are:GATEWAY
,NON_GATEWAY
.- Last
Accessed stringGateway Id (Output) The ID of the gateway the device accessed most recently.
- Last
Accessed stringGateway Time (Output) 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
,ASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway
Type String Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values are:GATEWAY
,NON_GATEWAY
.- last
Accessed StringGateway Id (Output) The ID of the gateway the device accessed most recently.
- last
Accessed StringGateway Time (Output) 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
,ASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway
Type string Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values are:GATEWAY
,NON_GATEWAY
.- last
Accessed stringGateway Id (Output) The ID of the gateway the device accessed most recently.
- last
Accessed stringGateway Time (Output) 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
,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_ strgateway_ id (Output) The ID of the gateway the device accessed most recently.
- last_
accessed_ strgateway_ time (Output) 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
,ASSOCIATION_AND_DEVICE_AUTH_TOKEN
.- gateway
Type String Indicates whether the device is a gateway. Default value is
NON_GATEWAY
. Possible values are:GATEWAY
,NON_GATEWAY
.- last
Accessed StringGateway Id (Output) The ID of the gateway the device accessed most recently.
- last
Accessed StringGateway Time (Output) The most recent time at which the device accessed the gateway specified in last_accessed_gateway.
DeviceLastErrorStatus, DeviceLastErrorStatusArgs
DeviceState, DeviceStateArgs
- Binary
Data string The device state data.
- Update
Time string The time at which this state version was updated in Cloud IoT Core.
- Binary
Data string The device state data.
- Update
Time string The time at which this state version was updated in Cloud IoT Core.
- binary
Data String The device state data.
- update
Time String The time at which this state version was updated in Cloud IoT Core.
- binary
Data string The device state data.
- update
Time 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.
- binary
Data String The device state data.
- update
Time 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.