github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/triton/r/triton_machine.html.markdown (about) 1 --- 2 layout: "triton" 3 page_title: "Triton: triton_machine" 4 sidebar_current: "docs-triton-resource-machine" 5 description: |- 6 The `triton_machine` resource represents a virtual machine or infrastructure container running in Triton. 7 --- 8 9 # triton\_machine 10 11 The `triton_machine` resource represents a virtual machine or infrastructure container running in Triton. 12 13 ## Example Usages 14 15 ### Run a SmartOS base-64 machine. 16 17 ```hcl 18 resource "triton_machine" "test-smartos" { 19 name = "test-smartos" 20 package = "g3-standard-0.25-smartos" 21 image = "842e6fa6-6e9b-11e5-8402-1b490459e334" 22 23 tags = { 24 hello = "world" 25 } 26 } 27 ``` 28 29 ### Run an Ubuntu 14.04 LTS machine. 30 31 ```hcl 32 resource "triton_machine" "test-ubuntu" { 33 name = "test-ubuntu" 34 package = "g4-general-4G" 35 image = "1996a1d6-c0d9-11e6-8b80-4772e39dc920" 36 firewall_enabled = true 37 root_authorized_keys = "Example Key" 38 user_script = "#!/bin/bash\necho 'testing user-script' >> /tmp/test.out\nhostname $IMAGENAME" 39 40 tags = { 41 purpose = "testing ubuntu" 42 } ## tags 43 } ## resource 44 ``` 45 46 ## Argument Reference 47 48 The following arguments are supported: 49 50 * `name` - (string) 51 The friendly name for the machine. Triton will generate a name if one is not specified. 52 53 * `tags` - (map) 54 A mapping of tags to apply to the machine. 55 56 * `package` - (string, Required) 57 The name of the package to use for provisioning. 58 59 * `image` - (string, Required) 60 The UUID of the image to provision. 61 62 * `nic` - (list of NIC blocks, Optional) 63 NICs associated with the machine. The fields allowed in a `NIC` block are defined below. 64 65 * `firewall_enabled` - (boolean) Default: `false` 66 Whether the cloud firewall should be enabled for this machine. 67 68 * `root_authorized_keys` - (string) 69 The public keys authorized for root access via SSH to the machine. 70 71 * `user_data` - (string) 72 Data to be copied to the machine on boot. 73 74 * `user_script` - (string) 75 The user script to run on boot (every boot on SmartMachines). 76 77 * `administrator_pw` - (string) 78 The initial password for the Administrator user. Only used for Windows virtual machines. 79 80 The nested `nic` block supports the following: 81 * `network` - (string, Optional) 82 The network id to attach to the network interface. It will be hex, in the format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. 83 84 ## Attribute Reference 85 86 The following attributes are exported: 87 88 * `id` - (string) - The identifier representing the firewall rule in Triton. 89 * `type` - (string) - The type of the machine (`smartmachine` or `virtualmachine`). 90 * `state` - (string) - The current state of the machine. 91 * `dataset` - (string) - The dataset URN with which the machine was provisioned. 92 * `memory` - (int) - The amount of memory the machine has (in Mb). 93 * `disk` - (int) - The amount of disk the machine has (in Gb). 94 * `ips` - (list of strings) - IP addresses of the machine. 95 * `primaryip` - (string) - The primary (public) IP address for the machine. 96 * `created` - (string) - The time at which the machine was created. 97 * `updated` - (string) - The time at which the machine was last updated.