github.com/jrasell/terraform@v0.6.17-0.20160523115548-2652f5232949/website/source/docs/providers/aws/r/opsworks_instance.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_opsworks_instance" 4 sidebar_current: "docs-aws-resource-opsworks-instance" 5 description: |- 6 Provides an OpsWorks instance resource. 7 --- 8 9 # aws\_opsworks\_instance 10 11 Provides an OpsWorks instance resource. 12 13 ## Example Usage 14 15 ``` 16 resource "aws_opsworks_instance" "my-instance" { 17 stack_id = "${aws_opsworks_stack.my-stack.id}" 18 19 layer_ids = [ 20 "${aws_opsworks_custom_layer.my-layer.id}", 21 ] 22 23 instance_type = "t2.micro" 24 os = "Amazon Linux 2015.09" 25 state = "stopped" 26 } 27 ``` 28 29 ## Argument Reference 30 31 The following arguments are supported: 32 33 * `instance_type` - (Required) The type of instance to start 34 * `stack_id` - (Required) The id of the stack the instance will belong to. 35 * `layer_ids` - (Required) The ids of the layers the instance will belong to. 36 * `state` - (Optional) The desired state of the instance. Can be either `"running"` or `"stopped"`. 37 * `install_updates_on_boot` - (Optional) Controls where to install OS and package updates when the instance boots. Defaults to `true`. 38 * `auto_scaling_type` - (Optional) Creates load-based or time-based instances. If set, can be either: `"load"` or `"timer"`. 39 * `availability_zone` - (Optional) Name of the availability zone where instances will be created 40 by default. 41 * `ebs_optimized` - (Optional) If true, the launched EC2 instance will be EBS-optimized. 42 * `hostname` - (Optional) The instance's host name. 43 * `architecture` - (Optional) Machine architecture for created instances. Can be either `"x86_64"` (the default) or `"i386"` 44 * `ami_id` - (Optional) The AMI to use for the instance. If an AMI is specified, `os` must be `"Custom"`. 45 * `os` - (Optional) Name of operating system that will be installed. 46 * `root_device_type` - (Optional) Name of the type of root device instances will have by default. Can be either `"ebs"` or `"instance-store"` 47 * `ssh_key_name` - (Optional) Name of the SSH keypair that instances will have by default. 48 * `agent_version` - (Optional) The AWS OpsWorks agent to install. Defaults to `"INHERIT"`. 49 * `subnet_id` - (Optional) Subnet ID to attach to 50 * `virtualization_type` - (Optional) Keyword to choose what virtualization mode created instances 51 will use. Can be either `"paravirtual"` or `"hvm"`. 52 * `root_block_device` - (Optional) Customize details about the root block 53 device of the instance. See [Block Devices](#block-devices) below for details. 54 * `ebs_block_device` - (Optional) Additional EBS block devices to attach to the 55 instance. See [Block Devices](#block-devices) below for details. 56 * `ephemeral_block_device` - (Optional) Customize Ephemeral (also known as 57 "Instance Store") volumes on the instance. See [Block Devices](#block-devices) below for details. 58 59 60 ## Block devices 61 62 Each of the `*_block_device` attributes controls a portion of the AWS 63 Instance's "Block Device Mapping". It's a good idea to familiarize yourself with [AWS's Block Device 64 Mapping docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) 65 to understand the implications of using these attributes. 66 67 The `root_block_device` mapping supports the following: 68 69 * `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, 70 or `"io1"`. (Default: `"standard"`). 71 * `volume_size` - (Optional) The size of the volume in gigabytes. 72 * `iops` - (Optional) The amount of provisioned 73 [IOPS](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). 74 This must be set with a `volume_type` of `"io1"`. 75 * `delete_on_termination` - (Optional) Whether the volume should be destroyed 76 on instance termination (Default: `true`). 77 78 Modifying any of the `root_block_device` settings requires resource 79 replacement. 80 81 Each `ebs_block_device` supports the following: 82 83 * `device_name` - The name of the device to mount. 84 * `snapshot_id` - (Optional) The Snapshot ID to mount. 85 * `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, 86 or `"io1"`. (Default: `"standard"`). 87 * `volume_size` - (Optional) The size of the volume in gigabytes. 88 * `iops` - (Optional) The amount of provisioned 89 [IOPS](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). 90 This must be set with a `volume_type` of `"io1"`. 91 * `delete_on_termination` - (Optional) Whether the volume should be destroyed 92 on instance termination (Default: `true`). 93 * `encrypted` - (Optional) Enables [EBS 94 encryption](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) 95 on the volume (Default: `false`). Cannot be used with `snapshot_id`. 96 97 Modifying any `ebs_block_device` currently requires resource replacement. 98 99 Each `ephemeral_block_device` supports the following: 100 101 * `device_name` - The name of the block device to mount on the instance. 102 * `virtual_name` - The [Instance Store Device 103 Name](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames) 104 (e.g. `"ephemeral0"`) 105 106 Each AWS Instance type has a different set of Instance Store block devices 107 available for attachment. AWS [publishes a 108 list](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes) 109 of which ephemeral devices are available on each type. The devices are always 110 identified by the `virtual_name` in the format `"ephemeral{0..N}"`. 111 112 ~> **NOTE:** Currently, changes to `*_block_device` configuration of _existing_ 113 resources cannot be automatically detected by Terraform. After making updates 114 to block device configuration, resource recreation can be manually triggered by 115 using the [`taint` command](/docs/commands/taint.html). 116 117 118 ## Attributes Reference 119 120 The following attributes are exported: 121 122 * `id` - The id of the OpsWorks instance. 123 * `agent_version` - The AWS OpsWorks agent version. 124 * `availability_zone` - The availability zone of the instance. 125 * `ssh_key_name` - The key name of the instance 126 * `public_dns` - The public DNS name assigned to the instance. For EC2-VPC, this 127 is only available if you've enabled DNS hostnames for your VPC 128 * `public_ip` - The public IP address assigned to the instance, if applicable. 129 * `private_dns` - The private DNS name assigned to the instance. Can only be 130 used inside the Amazon EC2, and only available if you've enabled DNS hostnames 131 for your VPC 132 * `private_ip` - The private IP address assigned to the instance 133 * `subnet_id` - The VPC subnet ID. 134 * `security_group_ids` - The associated security groups. 135