Instance
Provides an OpsWorks instance resource.
Example Usage
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(aws_opsworks_stack.main().id())
.layerIds(aws_opsworks_custom_layer.my-layer().id())
.instanceType("t2.micro")
.os("Amazon Linux 2015.09")
.state("stopped")
.build());
}
}
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](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_type
ofio1
.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_device
currently 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_name
in 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_type
ofio1
.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_device
settings requires resource replacement.
NOTE: Currently, changes to
*_block_device
configuration 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 theup
command 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