github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/cloudstack/r/instance.html.markdown (about) 1 --- 2 layout: "cloudstack" 3 page_title: "CloudStack: cloudstack_instance" 4 sidebar_current: "docs-cloudstack-resource-instance" 5 description: |- 6 Creates and automatically starts a virtual machine based on a service offering, disk offering, and template. 7 --- 8 9 # cloudstack_instance 10 11 Creates and automatically starts a virtual machine based on a service offering, 12 disk offering, and template. 13 14 ## Example Usage 15 16 ```hcl 17 resource "cloudstack_instance" "web" { 18 name = "server-1" 19 service_offering = "small" 20 network_id = "6eb22f91-7454-4107-89f4-36afcdf33021" 21 template = "CentOS 6.5" 22 zone = "zone-1" 23 } 24 ``` 25 26 ## Argument Reference 27 28 The following arguments are supported: 29 30 * `name` - (Required) The name of the instance. 31 32 * `display_name` - (Optional) The display name of the instance. 33 34 * `service_offering` - (Required) The name or ID of the service offering used 35 for this instance. 36 37 * `network_id` - (Optional) The ID of the network to connect this instance 38 to. Changing this forces a new resource to be created. 39 40 * `ip_address` - (Optional) The IP address to assign to this instance. Changing 41 this forces a new resource to be created. 42 43 * `template` - (Required) The name or ID of the template used for this 44 instance. Changing this forces a new resource to be created. 45 46 * `root_disk_size` - (Optional) The size of the root disk in gigabytes. The 47 root disk is resized on deploy. Only applies to template-based deployments. 48 Changing this forces a new resource to be created. 49 50 * `group` - (Optional) The group name of the instance. 51 52 * `affinity_group_ids` - (Optional) List of affinity group IDs to apply to this 53 instance. 54 55 * `affinity_group_names` - (Optional) List of affinity group names to apply to 56 this instance. 57 58 * `security_group_ids` - (Optional) List of security group IDs to apply to this 59 instance. Changing this forces a new resource to be created. 60 61 * `security_group_names` - (Optional) List of security group names to apply to 62 this instance. Changing this forces a new resource to be created. 63 64 * `project` - (Optional) The name or ID of the project to deploy this 65 instance to. Changing this forces a new resource to be created. 66 67 * `zone` - (Required) The name or ID of the zone where this instance will be 68 created. Changing this forces a new resource to be created. 69 70 * `user_data` - (Optional) The user data to provide when launching the 71 instance. 72 73 * `keypair` - (Optional) The name of the SSH key pair that will be used to 74 access this instance. 75 76 * `expunge` - (Optional) This determines if the instance is expunged when it is 77 destroyed (defaults false) 78 79 ## Attributes Reference 80 81 The following attributes are exported: 82 83 * `id` - The instance ID. 84 * `display_name` - The display name of the instance.