AmiFromInstanceArgs

data class AmiFromInstanceArgs(val deprecationTime: Output<String>? = null, val description: Output<String>? = null, val ebsBlockDevices: Output<List<AmiFromInstanceEbsBlockDeviceArgs>>? = null, val ephemeralBlockDevices: Output<List<AmiFromInstanceEphemeralBlockDeviceArgs>>? = null, val name: Output<String>? = null, val snapshotWithoutReboot: Output<Boolean>? = null, val sourceInstanceId: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<AmiFromInstanceArgs>

The "AMI from instance" resource allows the creation of an Amazon Machine Image (AMI) modelled after an existing EBS-backed EC2 instance. The created AMI will refer to implicitly-created snapshots of the instance's EBS volumes and mimick its assigned block device configuration at the time the resource is created. This resource is best applied to an instance that is stopped when this instance is created, so that the contents of the created image are predictable. When applied to an instance that is running, the instance will be stopped before taking the snapshots and then started back up again, resulting in a period of downtime. Note that the source instance is inspected only at the initial creation of this resource. Ongoing updates to the referenced instance will not be propagated into the generated AMI. Users may taint or otherwise recreate the resource in order to produce a fresh snapshot.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.AmiFromInstance;
import com.pulumi.aws.ec2.AmiFromInstanceArgs;
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 example = new AmiFromInstance("example", AmiFromInstanceArgs.builder()
.sourceInstanceId("i-xxxxxxxx")
.build());
}
}

Constructors

Link copied to clipboard
constructor(deprecationTime: Output<String>? = null, description: Output<String>? = null, ebsBlockDevices: Output<List<AmiFromInstanceEbsBlockDeviceArgs>>? = null, ephemeralBlockDevices: Output<List<AmiFromInstanceEphemeralBlockDeviceArgs>>? = null, name: Output<String>? = null, snapshotWithoutReboot: Output<Boolean>? = null, sourceInstanceId: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

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

Date and time to deprecate the AMI. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)

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

Longer, human-readable description for the AMI.

Link copied to clipboard

Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.

Link copied to clipboard

Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.

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

Region-unique name for the AMI.

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

Boolean that overrides the behavior of stopping the instance before snapshotting. This is risky since it may cause a snapshot of an inconsistent filesystem state, but can be used to avoid downtime if the user otherwise guarantees that no filesystem writes will be underway at the time of snapshot.

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

ID of the instance to use as the basis of the AMI.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Functions

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