github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    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  * `tenancy` - (Optional) Instance tenancy to use. Can be one of `"default"`, `"dedicated"` or `"host"`
    51  * `virtualization_type` - (Optional) Keyword to choose what virtualization mode created instances
    52    will use. Can be either `"paravirtual"` or `"hvm"`.
    53  * `root_block_device` - (Optional) Customize details about the root block
    54    device of the instance. See [Block Devices](#block-devices) below for details.
    55  * `ebs_block_device` - (Optional) Additional EBS block devices to attach to the
    56    instance.  See [Block Devices](#block-devices) below for details.
    57  * `ephemeral_block_device` - (Optional) Customize Ephemeral (also known as
    58    "Instance Store") volumes on the instance. See [Block Devices](#block-devices) below for details.
    59  
    60  
    61  ## Block devices
    62  
    63  Each of the `*_block_device` attributes controls a portion of the AWS
    64  Instance's "Block Device Mapping". It's a good idea to familiarize yourself with [AWS's Block Device
    65  Mapping docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html)
    66  to understand the implications of using these attributes.
    67  
    68  The `root_block_device` mapping supports the following:
    69  
    70  * `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`,
    71    or `"io1"`. (Default: `"standard"`).
    72  * `volume_size` - (Optional) The size of the volume in gigabytes.
    73  * `iops` - (Optional) The amount of provisioned
    74    [IOPS](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
    75    This must be set with a `volume_type` of `"io1"`.
    76  * `delete_on_termination` - (Optional) Whether the volume should be destroyed
    77    on instance termination (Default: `true`).
    78  
    79  Modifying any of the `root_block_device` settings requires resource
    80  replacement.
    81  
    82  Each `ebs_block_device` supports the following:
    83  
    84  * `device_name` - The name of the device to mount.
    85  * `snapshot_id` - (Optional) The Snapshot ID to mount.
    86  * `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`,
    87    or `"io1"`. (Default: `"standard"`).
    88  * `volume_size` - (Optional) The size of the volume in gigabytes.
    89  * `iops` - (Optional) The amount of provisioned
    90    [IOPS](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
    91    This must be set with a `volume_type` of `"io1"`.
    92  * `delete_on_termination` - (Optional) Whether the volume should be destroyed
    93    on instance termination (Default: `true`).
    94  
    95  Modifying any `ebs_block_device` currently requires resource replacement.
    96  
    97  Each `ephemeral_block_device` supports the following:
    98  
    99  * `device_name` - The name of the block device to mount on the instance.
   100  * `virtual_name` - The [Instance Store Device
   101    Name](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames)
   102    (e.g. `"ephemeral0"`)
   103  
   104  Each AWS Instance type has a different set of Instance Store block devices
   105  available for attachment. AWS [publishes a
   106  list](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes)
   107  of which ephemeral devices are available on each type. The devices are always
   108  identified by the `virtual_name` in the format `"ephemeral{0..N}"`.
   109  
   110  ~> **NOTE:** Currently, changes to `*_block_device` configuration of _existing_
   111  resources cannot be automatically detected by Terraform. After making updates
   112  to block device configuration, resource recreation can be manually triggered by
   113  using the [`taint` command](/docs/commands/taint.html).
   114  
   115  
   116  ## Attributes Reference
   117  
   118  The following attributes are exported:
   119  
   120  * `id` - The id of the OpsWorks instance.
   121  * `agent_version` - The AWS OpsWorks agent version.
   122  * `availability_zone` - The availability zone of the instance.
   123  * `ssh_key_name` - The key name of the instance
   124  * `public_dns` - The public DNS name assigned to the instance. For EC2-VPC, this
   125    is only available if you've enabled DNS hostnames for your VPC
   126  * `public_ip` - The public IP address assigned to the instance, if applicable.
   127  * `private_dns` - The private DNS name assigned to the instance. Can only be
   128    used inside the Amazon EC2, and only available if you've enabled DNS hostnames
   129    for your VPC
   130  * `private_ip` - The private IP address assigned to the instance
   131  * `subnet_id` - The VPC subnet ID.
   132  * `tenancy` - The Instance tenancy
   133  * `security_group_ids` - The associated security groups.
   134  
   135  ## Import
   136  
   137  Opsworks Instances can be imported using the `instance id`, e.g.
   138  
   139  ```
   140  $ terraform import aws_opsworks_instance.my_instance 4d6d1710-ded9-42a1-b08e-b043ad7af1e2
   141  ```
   142