2015-05-31 16:58:14 +02:00
|
|
|
---
|
|
|
|
layout: "packet"
|
|
|
|
page_title: "Packet: packet_device"
|
|
|
|
sidebar_current: "docs-packet-resource-device"
|
|
|
|
description: |-
|
|
|
|
Provides a Packet device resource. This can be used to create, modify, and delete devices.
|
|
|
|
---
|
|
|
|
|
|
|
|
# packet\_device
|
|
|
|
|
|
|
|
Provides a Packet device resource. This can be used to create,
|
|
|
|
modify, and delete devices.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2015-12-16 15:57:58 +01:00
|
|
|
# Create a device and add it to cool_project
|
2015-05-31 16:58:14 +02:00
|
|
|
resource "packet_device" "web1" {
|
2017-02-18 23:48:50 +01:00
|
|
|
hostname = "tf.coreos2"
|
|
|
|
plan = "baremetal_1"
|
|
|
|
facility = "ewr1"
|
|
|
|
operating_system = "coreos_stable"
|
|
|
|
billing_cycle = "hourly"
|
|
|
|
project_id = "${packet_project.cool_project.id}"
|
2015-05-31 16:58:14 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `hostname` - (Required) The device name
|
|
|
|
* `project_id` - (Required) The id of the project in which to create the device
|
|
|
|
* `operating_system` - (Required) The operating system slug
|
|
|
|
* `facility` - (Required) The facility in which to create the device
|
2015-12-16 15:57:58 +01:00
|
|
|
* `plan` - (Required) The hardware config slug
|
2015-05-31 16:58:14 +02:00
|
|
|
* `billing_cycle` - (Required) monthly or hourly
|
|
|
|
* `user_data` (Optional) - A string of the desired User Data for the device.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the device
|
|
|
|
* `hostname`- The hostname of the device
|
2015-12-16 15:57:58 +01:00
|
|
|
* `project_id`- The ID of the project the device belongs to
|
|
|
|
* `facility` - The facility the device is in
|
|
|
|
* `plan` - The hardware config of the device
|
2015-05-31 16:58:14 +02:00
|
|
|
* `network` - The private and public v4 and v6 IPs assigned to the device
|
2015-12-16 15:57:58 +01:00
|
|
|
* `locked` - Whether the device is locked
|
2015-05-31 16:58:14 +02:00
|
|
|
* `billing_cycle` - The billing cycle of the device (monthly or hourly)
|
|
|
|
* `operating_system` - The operating system running on the device
|
|
|
|
* `status` - The status of the device
|
|
|
|
* `created` - The timestamp for when the device was created
|
2015-12-16 15:57:58 +01:00
|
|
|
* `updated` - The timestamp for the last time the device was updated
|