github.com/ezbercih/terraform@v0.1.1-0.20140729011846-3c33865e0839/website/source/docs/providers/aws/r/instance.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_instance" 4 sidebar_current: "docs-aws-resource-instance" 5 --- 6 7 # aws\_instance 8 9 Provides an EC2 instance resource. This allows instances to be created, updated, 10 and deleted. Instances also support [provisioning](/docs/provisioners/index.html). 11 12 ## Example Usage 13 14 ``` 15 # Create a new instance of the ami-1234 on an m1.small node 16 resource "aws_instance" "web" { 17 ami = "ami-1234" 18 instance_type = "m1.small" 19 } 20 ``` 21 22 ## Argument Reference 23 24 The following arguments are supported: 25 26 * `ami` - (Required) The AMI to use for the instance. 27 * `availability_zone` - (Optional) The AZ to start the instance in. 28 * `instance_type` - (Required) The type of instance to start 29 * `key_name` - (Optional) The key name to use for the instance. 30 * `security_groups` - (Optional) A list of security group IDs or names to associate with. 31 If you are within a VPC, you'll need to use the security group ID. Otherwise, 32 for EC2, use the security group name. 33 * `subnet_id` - (Optional) The VPC Subnet ID to launch in. 34 * `source_dest_check` - (Optional) Controls if traffic is routed to the instance when 35 the destination address does not match the instance. Used for NAT or VPNs. Defaults false. 36 * `user_data` - (Optional) The user data to provide when launching the instance. 37 38 ## Attributes Reference 39 40 The following attributes are exported: 41 42 * `id` - The instance ID. 43 * `availability_zone` - The availability zone of the instance. 44 * `key_name` - The key name of the instance 45 * `private_dns` - The Private DNS name of the instance 46 * `private_ip` - The private IP address. 47 * `public_dns` - The public DNS name of the instance 48 * `public_ip` - The public IP address. 49 * `security_groups` - The associated security groups. 50 * `subnet_id` - The VPC subnet ID. 51