Show / Hide Table of Contents

Class AmiFromInstance

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.Ec2.AmiFromInstance("example", new Aws.Ec2.AmiFromInstanceArgs
    {
        SourceInstanceId = "i-xxxxxxxx",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
AmiFromInstance
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class AmiFromInstance : CustomResource

Constructors

View Source

AmiFromInstance(String, AmiFromInstanceArgs, CustomResourceOptions)

Create a AmiFromInstance resource with the given unique name, arguments, and options.

Declaration
public AmiFromInstance(string name, AmiFromInstanceArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

AmiFromInstanceArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Architecture

Machine architecture for created instances. Defaults to "x86_64".

Declaration
public Output<string> Architecture { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

A longer, human-readable description for the AMI.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

EbsBlockDevices

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

Declaration
public Output<ImmutableArray<AmiFromInstanceEbsBlockDevice>> EbsBlockDevices { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<AmiFromInstanceEbsBlockDevice>>
View Source

EnaSupport

Specifies whether enhanced networking with ENA is enabled. Defaults to false.

Declaration
public Output<bool> EnaSupport { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

EphemeralBlockDevices

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

Declaration
public Output<ImmutableArray<AmiFromInstanceEphemeralBlockDevice>> EphemeralBlockDevices { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<AmiFromInstanceEphemeralBlockDevice>>
View Source

ImageLocation

Path to an S3 object containing an image manifest, e.g. created by the ec2-upload-bundle command in the EC2 command line tools.

Declaration
public Output<string> ImageLocation { get; }
Property Value
Type Description
Output<System.String>
View Source

KernelId

The id of the kernel image (AKI) that will be used as the paravirtual kernel in created instances.

Declaration
public Output<string> KernelId { get; }
Property Value
Type Description
Output<System.String>
View Source

ManageEbsSnapshots

Declaration
public Output<bool> ManageEbsSnapshots { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Name

A region-unique name for the AMI.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

RamdiskId

The id of an initrd image (ARI) that will be used when booting the created instances.

Declaration
public Output<string> RamdiskId { get; }
Property Value
Type Description
Output<System.String>
View Source

RootDeviceName

The name of the root device (for example, /dev/sda1, or /dev/xvda).

Declaration
public Output<string> RootDeviceName { get; }
Property Value
Type Description
Output<System.String>
View Source

RootSnapshotId

Declaration
public Output<string> RootSnapshotId { get; }
Property Value
Type Description
Output<System.String>
View Source

SnapshotWithoutReboot

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.

Declaration
public Output<bool?> SnapshotWithoutReboot { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

SourceInstanceId

The id of the instance to use as the basis of the AMI.

Declaration
public Output<string> SourceInstanceId { get; }
Property Value
Type Description
Output<System.String>
View Source

SriovNetSupport

When set to "simple" (the default), enables enhanced networking for created instances. No other value is supported at this time.

Declaration
public Output<string> SriovNetSupport { get; }
Property Value
Type Description
Output<System.String>
View Source

Tags

A map of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VirtualizationType

Keyword to choose what virtualization mode created instances will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type changes the set of further arguments that are required, as described below.

Declaration
public Output<string> VirtualizationType { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, AmiFromInstanceState, CustomResourceOptions)

Get an existing AmiFromInstance resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static AmiFromInstance Get(string name, Input<string> id, AmiFromInstanceState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

AmiFromInstanceState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
AmiFromInstance
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.