Instance
Provides an OpsWorks instance resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const my_instance = new aws.opsworks.Instance("my-instance", {
    stackId: main.id,
    layerIds: [my_layer.id],
    instanceType: "t2.micro",
    os: "Amazon Linux 2015.09",
    state: "stopped",
});import pulumi
import pulumi_aws as aws
my_instance = aws.opsworks.Instance("my-instance",
    stack_id=main["id"],
    layer_ids=[my_layer["id"]],
    instance_type="t2.micro",
    os="Amazon Linux 2015.09",
    state="stopped")using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
    var my_instance = new Aws.OpsWorks.Instance("my-instance", new()
    {
        StackId = main.Id,
        LayerIds = new[]
        {
            my_layer.Id,
        },
        InstanceType = "t2.micro",
        Os = "Amazon Linux 2015.09",
        State = "stopped",
    });
});package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opsworks"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := opsworks.NewInstance(ctx, "my-instance", &opsworks.InstanceArgs{
			StackId: pulumi.Any(main.Id),
			LayerIds: pulumi.StringArray{
				my_layer.Id,
			},
			InstanceType: pulumi.String("t2.micro"),
			Os:           pulumi.String("Amazon Linux 2015.09"),
			State:        pulumi.String("stopped"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.opsworks.Instance;
import com.pulumi.aws.opsworks.InstanceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var my_instance = new Instance("my-instance", InstanceArgs.builder()
            .stackId(main.id())
            .layerIds(my_layer.id())
            .instanceType("t2.micro")
            .os("Amazon Linux 2015.09")
            .state("stopped")
            .build());
    }
}resources:
  my-instance:
    type: aws:opsworks:Instance
    properties:
      stackId: ${main.id}
      layerIds:
        - ${["my-layer"].id}
      instanceType: t2.micro
      os: Amazon Linux 2015.09
      state: stoppedBlock 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](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) to understand the implications of using these attributes.
 ebs_block_device
delete_on_termination- (Optional) Whether the volume should be destroyed on instance termination. Default istrue.device_name- (Required) Name of the device to mount.iops- (Optional) Amount of provisioned IOPS. This must be set with avolume_typeofio1.snapshot_id- (Optional) Snapshot ID to mount.volume_size- (Optional) Size of the volume in gigabytes.volume_type- (Optional) Type of volume. Valid values arestandard,gp2, orio1. Default isstandard. Modifying anyebs_block_devicecurrently requires resource replacement.
 ephemeral_block_device
device_name- Name of the block device to mount on the instance.virtual_name- The Instance Store Device Name (e.g.,ephemeral0). Each AWS Instance type has a different set of Instance Store block devices available for attachment. AWS [publishes alist](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes) of which ephemeral devices are available on each type. The devices are always identified by the
virtual_namein the formatephemeral{0..N}.
 root_block_device
delete_on_termination- (Optional) Whether the volume should be destroyed on instance termination. Default istrue.iops- (Optional) Amount of provisioned IOPS. This must be set with avolume_typeofio1.volume_size- (Optional) Size of the volume in gigabytes.volume_type- (Optional) Type of volume. Valid values arestandard,gp2, orio1. Default isstandard. Modifying any of theroot_block_devicesettings requires resource replacement.
NOTE: Currently, changes to
*_block_deviceconfiguration of existing resources cannot be automatically detected by this provider. After making updates to block device configuration, resource recreation can be manually triggered by using theupcommand with the --replace argument.
Import
Using pulumi import, import Opsworks Instances using the instance id. For example:
$ pulumi import aws:opsworks/instance:Instance my_instance 4d6d1710-ded9-42a1-b08e-b043ad7af1e2