|
| 1 | +--- |
| 2 | +layout: "scaleway" |
| 3 | +page_title: "Scaleway: scaleway_iot_hub_device" |
| 4 | +description: |- |
| 5 | + Manages Scaleway IoT Hub device. |
| 6 | +--- |
| 7 | + |
| 8 | +# scaleway_iot_hub_device |
| 9 | + |
| 10 | +-> **Note:** This terraform resource is currently in beta and might include breaking change in future releases. |
| 11 | + |
| 12 | +Creates and manages Scaleway IoT Hub Instances. For more information, see [the documentation](https://developers.scaleway.com/en/products/iot/api). |
| 13 | + |
| 14 | +## Examples |
| 15 | + |
| 16 | +### Basic |
| 17 | + |
| 18 | +```hcl |
| 19 | +resource scaleway_iot_hub main { |
| 20 | + name = "test-iot" |
| 21 | + product_plan = "plan_shared" |
| 22 | +} |
| 23 | +
|
| 24 | +resource scaleway_iot_hub_device main { |
| 25 | + hub_id = scaleway_iot_hub.main.id |
| 26 | + name = "test-iot" |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +## Arguments Reference |
| 31 | + |
| 32 | +The following arguments are supported: |
| 33 | + |
| 34 | +- `hub_id` - (Required) The ID of the hub on which this device will be created. |
| 35 | + |
| 36 | +- `name` - (Required) The name of the IoT device you want to create (e.g. `my-device`). |
| 37 | + |
| 38 | +~> **Important:** Updates to `name` will destroy and recreate a new resource. |
| 39 | + |
| 40 | +- `description` - (Optional) The description of the IoT device (e.g. `living room`). |
| 41 | + |
| 42 | +- `allow_insecure` - (Optional) Allow plain and server-authenticated TLS connections in addition to mutually-authenticated ones. |
| 43 | + |
| 44 | +~> **Important:** Updates to `allow_insecure` can disconnect eventually connected devices. |
| 45 | + |
| 46 | +- `allow_multiple_connections` - (Optional) Allow more than one simultaneous connection using the same device credentials. |
| 47 | + |
| 48 | +~> **Important:** Updates to `allow_multiple_connections` can disconnect eventually connected devices. |
| 49 | + |
| 50 | +- `message_filters` - (Optional) Rules that define which messages are authorized or denied based on their topic. |
| 51 | + - `publish` - (Optional) Rules used to restrict topics the device can publish to. |
| 52 | + - `policy` (Optional) Filtering policy (eg `accept` or `reject`) |
| 53 | + - `topics` (Optional) List of topics to match (eg `foo/bar/+/baz/#`) |
| 54 | + - `subscribe` - (Optional) Rules used to restrict topics the device can subscribe to. |
| 55 | + - `policy` (Optional) Same as publish rules. |
| 56 | + - `topics` (Optional) Same as publish rules. |
| 57 | + |
| 58 | + |
| 59 | +## Attributes Reference |
| 60 | + |
| 61 | +In addition to all arguments above, the following attributes are exported: |
| 62 | + |
| 63 | +- `id` - The ID of the device. |
| 64 | +- `created_at` - The date and time the device was created. |
| 65 | +- `updated_at` - The date and time the device resource was updated. |
| 66 | +- `certificate` - The certificate bundle of the device. |
| 67 | + - `crt` - The certificate of the device. |
| 68 | + - `key` - The private key of the device. |
| 69 | +- `status` - The current status of the device. |
| 70 | +- `last_activity_at` - The last MQTT activity of the device. |
| 71 | +- `is_connected` - The current connection status of the device. |
| 72 | + |
| 73 | + |
| 74 | +## Import |
| 75 | + |
| 76 | +IoT devices can be imported using the `{region}/{id}`, e.g. |
| 77 | + |
| 78 | +```bash |
| 79 | +$ terraform import scaleway_iot_device.device01 fr-par/11111111-1111-1111-1111-111111111111 |
| 80 | +``` |
0 commit comments