InstanceArgs

data class InstanceArgs(val agentVersion: Output<String>? = null, val amiId: Output<String>? = null, val architecture: Output<String>? = null, val autoScalingType: Output<String>? = null, val availabilityZone: Output<String>? = null, val createdAt: Output<String>? = null, val deleteEbs: Output<Boolean>? = null, val deleteEip: Output<Boolean>? = null, val ebsBlockDevices: Output<List<InstanceEbsBlockDeviceArgs>>? = null, val ebsOptimized: Output<Boolean>? = null, val ecsClusterArn: Output<String>? = null, val elasticIp: Output<String>? = null, val ephemeralBlockDevices: Output<List<InstanceEphemeralBlockDeviceArgs>>? = null, val hostname: Output<String>? = null, val infrastructureClass: Output<String>? = null, val installUpdatesOnBoot: Output<Boolean>? = null, val instanceProfileArn: Output<String>? = null, val instanceType: Output<String>? = null, val layerIds: Output<List<String>>? = null, val os: Output<String>? = null, val rootBlockDevices: Output<List<InstanceRootBlockDeviceArgs>>? = null, val rootDeviceType: Output<String>? = null, val securityGroupIds: Output<List<String>>? = null, val sshKeyName: Output<String>? = null, val stackId: Output<String>? = null, val state: Output<String>? = null, val status: Output<String>? = null, val subnetId: Output<String>? = null, val tenancy: Output<String>? = null, val virtualizationType: Output<String>? = null) : ConvertibleToJava<InstanceArgs>

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&#46;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 is true.

  • device_name - (Required) Name of the device to mount.

  • iops - (Optional) Amount of provisioned IOPS. This must be set with a volume_type of io1.

  • snapshot_id - (Optional) Snapshot ID to mount.

  • volume_size - (Optional) Size of the volume in gigabytes.

  • volume_type - (Optional) Type of volume. Valid values are standard, gp2, or io1. Default is standard. Modifying any ebs_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 a

  • list](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 format ephemeral{0..N}.

root_block_device

  • delete_on_termination - (Optional) Whether the volume should be destroyed on instance termination. Default is true.

  • iops - (Optional) Amount of provisioned IOPS. This must be set with a volume_type of io1.

  • volume_size - (Optional) Size of the volume in gigabytes.

  • volume_type - (Optional) Type of volume. Valid values are standard, gp2, or io1. Default is standard. Modifying any of the root_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 the up 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

Link copied to clipboard
constructor(agentVersion: Output<String>? = null, amiId: Output<String>? = null, architecture: Output<String>? = null, autoScalingType: Output<String>? = null, availabilityZone: Output<String>? = null, createdAt: Output<String>? = null, deleteEbs: Output<Boolean>? = null, deleteEip: Output<Boolean>? = null, ebsBlockDevices: Output<List<InstanceEbsBlockDeviceArgs>>? = null, ebsOptimized: Output<Boolean>? = null, ecsClusterArn: Output<String>? = null, elasticIp: Output<String>? = null, ephemeralBlockDevices: Output<List<InstanceEphemeralBlockDeviceArgs>>? = null, hostname: Output<String>? = null, infrastructureClass: Output<String>? = null, installUpdatesOnBoot: Output<Boolean>? = null, instanceProfileArn: Output<String>? = null, instanceType: Output<String>? = null, layerIds: Output<List<String>>? = null, os: Output<String>? = null, rootBlockDevices: Output<List<InstanceRootBlockDeviceArgs>>? = null, rootDeviceType: Output<String>? = null, securityGroupIds: Output<List<String>>? = null, sshKeyName: Output<String>? = null, stackId: Output<String>? = null, state: Output<String>? = null, status: Output<String>? = null, subnetId: Output<String>? = null, tenancy: Output<String>? = null, virtualizationType: Output<String>? = null)

Properties

Link copied to clipboard
val agentVersion: Output<String>? = null

OpsWorks agent to install. Default is INHERIT.

Link copied to clipboard
val amiId: Output<String>? = null

AMI to use for the instance. If an AMI is specified, os must be Custom.

Link copied to clipboard
val architecture: Output<String>? = null

Machine architecture for created instances. Valid values are x86_64 or i386. The default is x86_64.

Link copied to clipboard
val autoScalingType: Output<String>? = null

Creates load-based or time-based instances. Valid values are load, timer.

Link copied to clipboard
val availabilityZone: Output<String>? = null

Name of the availability zone where instances will be created by default.

Link copied to clipboard
val createdAt: Output<String>? = null

Time that the instance was created.

Link copied to clipboard
val deleteEbs: Output<Boolean>? = null

Whether to delete EBS volume on deletion. Default is true.

Link copied to clipboard
val deleteEip: Output<Boolean>? = null

Whether to delete the Elastic IP on deletion.

Link copied to clipboard

Configuration block for additional EBS block devices to attach to the instance. See Block Devices below.

Link copied to clipboard
val ebsOptimized: Output<Boolean>? = null

Whether the launched EC2 instance will be EBS-optimized.

Link copied to clipboard
val ecsClusterArn: Output<String>? = null

ECS cluster's ARN for container instances.

Link copied to clipboard
val elasticIp: Output<String>? = null

Instance Elastic IP address.

Link copied to clipboard

Configuration block for ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below.

Link copied to clipboard
val hostname: Output<String>? = null

Instance's host name.

Link copied to clipboard
val infrastructureClass: Output<String>? = null

For registered instances, infrastructure class: ec2 or on-premises.

Link copied to clipboard
val installUpdatesOnBoot: Output<Boolean>? = null

Controls where to install OS and package updates when the instance boots. Default is true.

Link copied to clipboard
val instanceProfileArn: Output<String>? = null

ARN of the instance's IAM profile.

Link copied to clipboard
val instanceType: Output<String>? = null

Type of instance to start.

Link copied to clipboard
val layerIds: Output<List<String>>? = null

List of the layers the instance will belong to.

Link copied to clipboard
val os: Output<String>? = null

Name of operating system that will be installed.

Link copied to clipboard

Configuration block for the root block device of the instance. See Block Devices below.

Link copied to clipboard
val rootDeviceType: Output<String>? = null

Name of the type of root device instances will have by default. Valid values are ebs or instance-store.

Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null

Associated security groups.

Link copied to clipboard
val sshKeyName: Output<String>? = null

Name of the SSH keypair that instances will have by default.

Link copied to clipboard
val stackId: Output<String>? = null

Identifier of the stack the instance will belong to. The following arguments are optional:

Link copied to clipboard
val state: Output<String>? = null

Desired state of the instance. Valid values are running or stopped.

Link copied to clipboard
val status: Output<String>? = null

Instance status. Will be one of booting, connection_lost, online, pending, rebooting, requested, running_setup, setup_failed, shutting_down, start_failed, stop_failed, stopped, stopping, terminated, or terminating.

Link copied to clipboard
val subnetId: Output<String>? = null

Subnet ID to attach to.

Link copied to clipboard
val tenancy: Output<String>? = null

Instance tenancy to use. Valid values are default, dedicated or host.

Link copied to clipboard
val virtualizationType: Output<String>? = null

Keyword to choose what virtualization mode created instances will use. Valid values are paravirtual or hvm.

Functions

Link copied to clipboard
open override fun toJava(): InstanceArgs