-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
41 lines (34 loc) · 954 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Terraform 0.12 compatible
variable "hostname" {}
variable "plan" {}
variable "operating_system" {}
variable "locations" {}
variable "auth_token" {}
variable "org_id" {}
variable "project_id" {}
variable "ssh_public_key" {}
# Configure the Packet Provider.
provider "packet" {
auth_token = var.auth_token
}
resource "packet_project_ssh_key" "rougue01" {
name = "rougue01"
public_key = file(var.ssh_public_key)
project_id = var.project_id
}
# Instantiate a bare metal server
resource "packet_device" "rougue01" {
hostname = var.hostname
plan = var.plan
facilities = var.locations
operating_system = var.operating_system
billing_cycle = "hourly"
project_id = var.project_id
project_ssh_key_ids = [packet_project_ssh_key.rougue01.id]
}
output "ipv4" {
value = packet_device.rougue01.access_public_ipv4
}
#output "root_password" {
# value = packet_device.rougue01.root_password
#}