github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/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  
    94  Modifying any `ebs_block_device` currently requires resource replacement.
    95  
    96  Each `ephemeral_block_device` supports the following:
    97  
    98  * `device_name` - The name of the block device to mount on the instance.
    99  * `virtual_name` - The [Instance Store Device
   100    Name](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames)
   101    (e.g. `"ephemeral0"`)
   102  
   103  Each AWS Instance type has a different set of Instance Store block devices
   104  available for attachment. AWS [publishes a
   105  list](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes)
   106  of which ephemeral devices are available on each type. The devices are always
   107  identified by the `virtual_name` in the format `"ephemeral{0..N}"`.
   108  
   109  ~> **NOTE:** Currently, changes to `*_block_device` configuration of _existing_
   110  resources cannot be automatically detected by Terraform. After making updates
   111  to block device configuration, resource recreation can be manually triggered by
   112  using the [`taint` command](/docs/commands/taint.html).
   113  
   114  
   115  ## Attributes Reference
   116  
   117  The following attributes are exported:
   118  
   119  * `id` - The id of the OpsWorks instance.
   120  * `agent_version` - The AWS OpsWorks agent version.
   121  * `availability_zone` - The availability zone of the instance.
   122  * `ssh_key_name` - The key name of the instance
   123  * `public_dns` - The public DNS name assigned to the instance. For EC2-VPC, this 
   124    is only available if you've enabled DNS hostnames for your VPC
   125  * `public_ip` - The public IP address assigned to the instance, if applicable.
   126  * `private_dns` - The private DNS name assigned to the instance. Can only be 
   127    used inside the Amazon EC2, and only available if you've enabled DNS hostnames 
   128    for your VPC
   129  * `private_ip` - The private IP address assigned to the instance
   130  * `subnet_id` - The VPC subnet ID.
   131  * `security_group_ids` - The associated security groups.
   132