Class Ami
The AMI resource allows the creation and management of a completely-custom Amazon Machine Image (AMI).
If you just want to duplicate an existing AMI, possibly copying it to another
region, it's better to use aws.ec2.AmiCopy instead.
If you just want to share an existing AMI with another AWS account,
it's better to use aws.ec2.AmiLaunchPermission instead.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
// Create an AMI that will start a machine whose root device is backed by
// an EBS volume populated from a snapshot. It is assumed that such a snapshot
// already exists with the id "snap-xxxxxxxx".
var example = new Aws.Ec2.Ami("example", new Aws.Ec2.AmiArgs
{
EbsBlockDevices =
{
new Aws.Ec2.Inputs.AmiEbsBlockDeviceArgs
{
DeviceName = "/dev/xvda",
SnapshotId = "snap-xxxxxxxx",
VolumeSize = 8,
},
},
RootDeviceName = "/dev/xvda",
VirtualizationType = "hvm",
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class Ami : CustomResource
Constructors
View SourceAmi(String, AmiArgs, CustomResourceOptions)
Create a Ami resource with the given unique name, arguments, and options.
Declaration
public Ami(string name, AmiArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| AmiArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArchitecture
Machine architecture for created instances. Defaults to "x86_64".
Declaration
public Output<string> Architecture { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A longer, human-readable description for the AMI.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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<AmiEbsBlockDevice>> EbsBlockDevices { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<AmiEbsBlockDevice>> |
EnaSupport
Specifies whether enhanced networking with ENA is enabled. Defaults to false.
Declaration
public Output<bool?> EnaSupport { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
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<AmiEphemeralBlockDevice>> EphemeralBlockDevices { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<AmiEphemeralBlockDevice>> |
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> |
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> |
ManageEbsSnapshots
Declaration
public Output<bool> ManageEbsSnapshots { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Name
A region-unique name for the AMI.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
RootSnapshotId
The Snapshot ID for the root volume (for EBS-backed AMIs)
Declaration
public Output<string> RootSnapshotId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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>> |
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 SourceGet(String, Input<String>, AmiState, CustomResourceOptions)
Get an existing Ami resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Ami Get(string name, Input<string> id, AmiState 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. |
| AmiState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Ami |