Instance

class Instance : KotlinCustomResource

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 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

Properties

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

OpsWorks agent to install. Default is INHERIT.

Link copied to clipboard
val amiId: Output<String>

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

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

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>?

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

Link copied to clipboard

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

Link copied to clipboard
val createdAt: Output<String>

Time that the instance was created.

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

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

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

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>?

Whether the launched EC2 instance will be EBS-optimized.

Link copied to clipboard
val ec2InstanceId: Output<String>

EC2 instance ID.

Link copied to clipboard
val ecsClusterArn: Output<String>

ECS cluster's ARN for container instances.

Link copied to clipboard
val elasticIp: Output<String>

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>

Instance's host name.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

ARN of the instance's IAM profile.

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

Type of instance to start.

Link copied to clipboard

ID of the last service error.

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

List of the layers the instance will belong to.

Link copied to clipboard
val os: Output<String>

Name of operating system that will be installed.

Link copied to clipboard
val platform: Output<String>

Instance's platform.

Link copied to clipboard
val privateDns: Output<String>

Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC.

Link copied to clipboard
val privateIp: Output<String>

Private IP address assigned to the instance.

Link copied to clipboard
val publicDns: Output<String>

Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC.

Link copied to clipboard
val publicIp: Output<String>

Public IP address assigned to the instance, if applicable.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val registeredBy: Output<String>

For registered instances, who performed the registration.

Link copied to clipboard

Instance's reported AWS OpsWorks Stacks agent version.

Link copied to clipboard

For registered instances, the reported operating system family.

Link copied to clipboard
val reportedOsName: Output<String>

For registered instances, the reported operating system name.

Link copied to clipboard

For registered instances, the reported operating system version.

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>

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

Link copied to clipboard

Root device volume ID.

Link copied to clipboard

Associated security groups.

Link copied to clipboard

SSH key's Deep Security Agent (DSA) fingerprint.

Link copied to clipboard

SSH key's RSA fingerprint.

Link copied to clipboard
val sshKeyName: Output<String>

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

Link copied to clipboard
val stackId: Output<String>

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

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

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

Link copied to clipboard
val status: Output<String>

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>

Subnet ID to attach to.

Link copied to clipboard
val tenancy: Output<String>

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

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

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