Resource: aws_opsworks_instance

Provides an OpsWorks instance resource.

Example Usage

resource "aws_opsworks_instance" "my-instance" {
  stack_id = aws_opsworks_stack.main.id

  layer_ids = [
    aws_opsworks_custom_layer.my-layer.id,
  ]

  instance_type = "t2.micro"
  os            = "Amazon Linux 2015.09"
  state         = "stopped"
}

Argument Reference

The following arguments are required:

The following arguments are optional:

Block devices

Each of the *_block_device attributes controls a portion of the AWS Instance's "Block Device Mapping". It's a good idea to familiarize yourself with AWS's Block Device Mapping docs to understand the implications of using these attributes.

ebs_block_device

Modifying any ebs_block_device currently requires resource replacement.

ephemeral_block_device

Each AWS Instance type has a different set of Instance Store block devices available for attachment. AWS publishes a list of which ephemeral devices are available on each type. The devices are always identified by the virtual_name in the format ephemeral{0..N}.

root_block_device

Modifying any of the root_block_device settings requires resource replacement.

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import Opsworks Instances using the instance id. For example:

import {
  to = aws_opsworks_instance.my_instance
  id = "4d6d1710-ded9-42a1-b08e-b043ad7af1e2"
}

Using terraform import, import Opsworks Instances using the instance id. For example:

% terraform import aws_opsworks_instance.my_instance 4d6d1710-ded9-42a1-b08e-b043ad7af1e2