Instance Args
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: stopped
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
Constructors
Properties
OpsWorks agent to install. Default is INHERIT
.
Machine architecture for created instances. Valid values are x86_64
or i386
. The default is x86_64
.
Creates load-based or time-based instances. Valid values are load
, timer
.
Name of the availability zone where instances will be created by default.
Configuration block for additional EBS block devices to attach to the instance. See Block Devices below.
Whether the launched EC2 instance will be EBS-optimized.
ECS cluster's ARN for container instances.
Configuration block for ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below.
For registered instances, infrastructure class: ec2 or on-premises.
Controls where to install OS and package updates when the instance boots. Default is true
.
ARN of the instance's IAM profile.
Type of instance to start.
Configuration block for the root block device of the instance. See Block Devices below.
Name of the type of root device instances will have by default. Valid values are ebs
or instance-store
.
Associated security groups.
Name of the SSH keypair that instances will have by default.
Keyword to choose what virtualization mode created instances will use. Valid values are paravirtual
or hvm
.