1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. Ami
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.ec2.Ami

Explore with Pulumi AI

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Create an AMI that will start a machine whose root device is backed by
// an EBS volume populated from a snapshot. We assume that such a snapshot
// already exists with the id "snap-xxxxxxxx".
const example = new aws.ec2.Ami("example", {
    name: "example",
    virtualizationType: "hvm",
    rootDeviceName: "/dev/xvda",
    imdsSupport: "v2.0",
    ebsBlockDevices: [{
        deviceName: "/dev/xvda",
        snapshotId: "snap-xxxxxxxx",
        volumeSize: 8,
    }],
});
Copy
import pulumi
import pulumi_aws as aws

# Create an AMI that will start a machine whose root device is backed by
# an EBS volume populated from a snapshot. We assume that such a snapshot
# already exists with the id "snap-xxxxxxxx".
example = aws.ec2.Ami("example",
    name="example",
    virtualization_type="hvm",
    root_device_name="/dev/xvda",
    imds_support="v2.0",
    ebs_block_devices=[{
        "device_name": "/dev/xvda",
        "snapshot_id": "snap-xxxxxxxx",
        "volume_size": 8,
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create an AMI that will start a machine whose root device is backed by
		// an EBS volume populated from a snapshot. We assume that such a snapshot
		// already exists with the id "snap-xxxxxxxx".
		_, err := ec2.NewAmi(ctx, "example", &ec2.AmiArgs{
			Name:               pulumi.String("example"),
			VirtualizationType: pulumi.String("hvm"),
			RootDeviceName:     pulumi.String("/dev/xvda"),
			ImdsSupport:        pulumi.String("v2.0"),
			EbsBlockDevices: ec2.AmiEbsBlockDeviceArray{
				&ec2.AmiEbsBlockDeviceArgs{
					DeviceName: pulumi.String("/dev/xvda"),
					SnapshotId: pulumi.String("snap-xxxxxxxx"),
					VolumeSize: pulumi.Int(8),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // Create an AMI that will start a machine whose root device is backed by
    // an EBS volume populated from a snapshot. We assume that such a snapshot
    // already exists with the id "snap-xxxxxxxx".
    var example = new Aws.Ec2.Ami("example", new()
    {
        Name = "example",
        VirtualizationType = "hvm",
        RootDeviceName = "/dev/xvda",
        ImdsSupport = "v2.0",
        EbsBlockDevices = new[]
        {
            new Aws.Ec2.Inputs.AmiEbsBlockDeviceArgs
            {
                DeviceName = "/dev/xvda",
                SnapshotId = "snap-xxxxxxxx",
                VolumeSize = 8,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ami;
import com.pulumi.aws.ec2.AmiArgs;
import com.pulumi.aws.ec2.inputs.AmiEbsBlockDeviceArgs;
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) {
        // Create an AMI that will start a machine whose root device is backed by
        // an EBS volume populated from a snapshot. We assume that such a snapshot
        // already exists with the id "snap-xxxxxxxx".
        var example = new Ami("example", AmiArgs.builder()
            .name("example")
            .virtualizationType("hvm")
            .rootDeviceName("/dev/xvda")
            .imdsSupport("v2.0")
            .ebsBlockDevices(AmiEbsBlockDeviceArgs.builder()
                .deviceName("/dev/xvda")
                .snapshotId("snap-xxxxxxxx")
                .volumeSize(8)
                .build())
            .build());

    }
}
Copy
resources:
  # Create an AMI that will start a machine whose root device is backed by
  # an EBS volume populated from a snapshot. We assume that such a snapshot
  # already exists with the id "snap-xxxxxxxx".
  example:
    type: aws:ec2:Ami
    properties:
      name: example
      virtualizationType: hvm
      rootDeviceName: /dev/xvda
      imdsSupport: v2.0
      ebsBlockDevices:
        - deviceName: /dev/xvda
          snapshotId: snap-xxxxxxxx
          volumeSize: 8
Copy

Create Ami Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Ami(name: string, args?: AmiArgs, opts?: CustomResourceOptions);
@overload
def Ami(resource_name: str,
        args: Optional[AmiArgs] = None,
        opts: Optional[ResourceOptions] = None)

@overload
def Ami(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        architecture: Optional[str] = None,
        boot_mode: Optional[str] = None,
        deprecation_time: Optional[str] = None,
        description: Optional[str] = None,
        ebs_block_devices: Optional[Sequence[AmiEbsBlockDeviceArgs]] = None,
        ena_support: Optional[bool] = None,
        ephemeral_block_devices: Optional[Sequence[AmiEphemeralBlockDeviceArgs]] = None,
        image_location: Optional[str] = None,
        imds_support: Optional[str] = None,
        kernel_id: Optional[str] = None,
        name: Optional[str] = None,
        ramdisk_id: Optional[str] = None,
        root_device_name: Optional[str] = None,
        sriov_net_support: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tpm_support: Optional[str] = None,
        uefi_data: Optional[str] = None,
        virtualization_type: Optional[str] = None)
func NewAmi(ctx *Context, name string, args *AmiArgs, opts ...ResourceOption) (*Ami, error)
public Ami(string name, AmiArgs? args = null, CustomResourceOptions? opts = null)
public Ami(String name, AmiArgs args)
public Ami(String name, AmiArgs args, CustomResourceOptions options)
type: aws:ec2:Ami
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args AmiArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args AmiArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args AmiArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args AmiArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AmiArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var amiResource = new Aws.Ec2.Ami("amiResource", new()
{
    Architecture = "string",
    BootMode = "string",
    DeprecationTime = "string",
    Description = "string",
    EbsBlockDevices = new[]
    {
        new Aws.Ec2.Inputs.AmiEbsBlockDeviceArgs
        {
            DeviceName = "string",
            DeleteOnTermination = false,
            Encrypted = false,
            Iops = 0,
            OutpostArn = "string",
            SnapshotId = "string",
            Throughput = 0,
            VolumeSize = 0,
            VolumeType = "string",
        },
    },
    EnaSupport = false,
    EphemeralBlockDevices = new[]
    {
        new Aws.Ec2.Inputs.AmiEphemeralBlockDeviceArgs
        {
            DeviceName = "string",
            VirtualName = "string",
        },
    },
    ImageLocation = "string",
    ImdsSupport = "string",
    KernelId = "string",
    Name = "string",
    RamdiskId = "string",
    RootDeviceName = "string",
    SriovNetSupport = "string",
    Tags = 
    {
        { "string", "string" },
    },
    TpmSupport = "string",
    UefiData = "string",
    VirtualizationType = "string",
});
Copy
example, err := ec2.NewAmi(ctx, "amiResource", &ec2.AmiArgs{
	Architecture:    pulumi.String("string"),
	BootMode:        pulumi.String("string"),
	DeprecationTime: pulumi.String("string"),
	Description:     pulumi.String("string"),
	EbsBlockDevices: ec2.AmiEbsBlockDeviceArray{
		&ec2.AmiEbsBlockDeviceArgs{
			DeviceName:          pulumi.String("string"),
			DeleteOnTermination: pulumi.Bool(false),
			Encrypted:           pulumi.Bool(false),
			Iops:                pulumi.Int(0),
			OutpostArn:          pulumi.String("string"),
			SnapshotId:          pulumi.String("string"),
			Throughput:          pulumi.Int(0),
			VolumeSize:          pulumi.Int(0),
			VolumeType:          pulumi.String("string"),
		},
	},
	EnaSupport: pulumi.Bool(false),
	EphemeralBlockDevices: ec2.AmiEphemeralBlockDeviceArray{
		&ec2.AmiEphemeralBlockDeviceArgs{
			DeviceName:  pulumi.String("string"),
			VirtualName: pulumi.String("string"),
		},
	},
	ImageLocation:   pulumi.String("string"),
	ImdsSupport:     pulumi.String("string"),
	KernelId:        pulumi.String("string"),
	Name:            pulumi.String("string"),
	RamdiskId:       pulumi.String("string"),
	RootDeviceName:  pulumi.String("string"),
	SriovNetSupport: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	TpmSupport:         pulumi.String("string"),
	UefiData:           pulumi.String("string"),
	VirtualizationType: pulumi.String("string"),
})
Copy
var amiResource = new Ami("amiResource", AmiArgs.builder()
    .architecture("string")
    .bootMode("string")
    .deprecationTime("string")
    .description("string")
    .ebsBlockDevices(AmiEbsBlockDeviceArgs.builder()
        .deviceName("string")
        .deleteOnTermination(false)
        .encrypted(false)
        .iops(0)
        .outpostArn("string")
        .snapshotId("string")
        .throughput(0)
        .volumeSize(0)
        .volumeType("string")
        .build())
    .enaSupport(false)
    .ephemeralBlockDevices(AmiEphemeralBlockDeviceArgs.builder()
        .deviceName("string")
        .virtualName("string")
        .build())
    .imageLocation("string")
    .imdsSupport("string")
    .kernelId("string")
    .name("string")
    .ramdiskId("string")
    .rootDeviceName("string")
    .sriovNetSupport("string")
    .tags(Map.of("string", "string"))
    .tpmSupport("string")
    .uefiData("string")
    .virtualizationType("string")
    .build());
Copy
ami_resource = aws.ec2.Ami("amiResource",
    architecture="string",
    boot_mode="string",
    deprecation_time="string",
    description="string",
    ebs_block_devices=[{
        "device_name": "string",
        "delete_on_termination": False,
        "encrypted": False,
        "iops": 0,
        "outpost_arn": "string",
        "snapshot_id": "string",
        "throughput": 0,
        "volume_size": 0,
        "volume_type": "string",
    }],
    ena_support=False,
    ephemeral_block_devices=[{
        "device_name": "string",
        "virtual_name": "string",
    }],
    image_location="string",
    imds_support="string",
    kernel_id="string",
    name="string",
    ramdisk_id="string",
    root_device_name="string",
    sriov_net_support="string",
    tags={
        "string": "string",
    },
    tpm_support="string",
    uefi_data="string",
    virtualization_type="string")
Copy
const amiResource = new aws.ec2.Ami("amiResource", {
    architecture: "string",
    bootMode: "string",
    deprecationTime: "string",
    description: "string",
    ebsBlockDevices: [{
        deviceName: "string",
        deleteOnTermination: false,
        encrypted: false,
        iops: 0,
        outpostArn: "string",
        snapshotId: "string",
        throughput: 0,
        volumeSize: 0,
        volumeType: "string",
    }],
    enaSupport: false,
    ephemeralBlockDevices: [{
        deviceName: "string",
        virtualName: "string",
    }],
    imageLocation: "string",
    imdsSupport: "string",
    kernelId: "string",
    name: "string",
    ramdiskId: "string",
    rootDeviceName: "string",
    sriovNetSupport: "string",
    tags: {
        string: "string",
    },
    tpmSupport: "string",
    uefiData: "string",
    virtualizationType: "string",
});
Copy
type: aws:ec2:Ami
properties:
    architecture: string
    bootMode: string
    deprecationTime: string
    description: string
    ebsBlockDevices:
        - deleteOnTermination: false
          deviceName: string
          encrypted: false
          iops: 0
          outpostArn: string
          snapshotId: string
          throughput: 0
          volumeSize: 0
          volumeType: string
    enaSupport: false
    ephemeralBlockDevices:
        - deviceName: string
          virtualName: string
    imageLocation: string
    imdsSupport: string
    kernelId: string
    name: string
    ramdiskId: string
    rootDeviceName: string
    sriovNetSupport: string
    tags:
        string: string
    tpmSupport: string
    uefiData: string
    virtualizationType: string
Copy

Ami Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Ami resource accepts the following input properties:

Architecture Changes to this property will trigger replacement. string
Machine architecture for created instances. Defaults to "x86_64".
BootMode Changes to this property will trigger replacement. string
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
DeprecationTime string
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)
Description string
Longer, human-readable description for the AMI.
EbsBlockDevices List<AmiEbsBlockDevice>
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
EnaSupport Changes to this property will trigger replacement. bool
Whether enhanced networking with ENA is enabled. Defaults to false.
EphemeralBlockDevices Changes to this property will trigger replacement. List<AmiEphemeralBlockDevice>
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
ImageLocation Changes to this property will trigger replacement. string
ImdsSupport Changes to this property will trigger replacement. string
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
KernelId Changes to this property will trigger replacement. string
Name Changes to this property will trigger replacement. string
Region-unique name for the AMI.
RamdiskId Changes to this property will trigger replacement. string
RootDeviceName Changes to this property will trigger replacement. string
Name of the root device (for example, /dev/sda1, or /dev/xvda).
SriovNetSupport Changes to this property will trigger replacement. string
Tags Dictionary<string, string>
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.
TpmSupport Changes to this property will trigger replacement. string
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
UefiData Changes to this property will trigger replacement. string
Base64 representation of the non-volatile UEFI variable store.
VirtualizationType Changes to this property will trigger replacement. string
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.
Architecture Changes to this property will trigger replacement. string
Machine architecture for created instances. Defaults to "x86_64".
BootMode Changes to this property will trigger replacement. string
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
DeprecationTime string
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)
Description string
Longer, human-readable description for the AMI.
EbsBlockDevices []AmiEbsBlockDeviceArgs
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
EnaSupport Changes to this property will trigger replacement. bool
Whether enhanced networking with ENA is enabled. Defaults to false.
EphemeralBlockDevices Changes to this property will trigger replacement. []AmiEphemeralBlockDeviceArgs
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
ImageLocation Changes to this property will trigger replacement. string
ImdsSupport Changes to this property will trigger replacement. string
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
KernelId Changes to this property will trigger replacement. string
Name Changes to this property will trigger replacement. string
Region-unique name for the AMI.
RamdiskId Changes to this property will trigger replacement. string
RootDeviceName Changes to this property will trigger replacement. string
Name of the root device (for example, /dev/sda1, or /dev/xvda).
SriovNetSupport Changes to this property will trigger replacement. string
Tags map[string]string
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.
TpmSupport Changes to this property will trigger replacement. string
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
UefiData Changes to this property will trigger replacement. string
Base64 representation of the non-volatile UEFI variable store.
VirtualizationType Changes to this property will trigger replacement. string
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.
architecture Changes to this property will trigger replacement. String
Machine architecture for created instances. Defaults to "x86_64".
bootMode Changes to this property will trigger replacement. String
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecationTime String
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)
description String
Longer, human-readable description for the AMI.
ebsBlockDevices List<AmiEbsBlockDevice>
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
enaSupport Changes to this property will trigger replacement. Boolean
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeralBlockDevices Changes to this property will trigger replacement. List<AmiEphemeralBlockDevice>
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
imageLocation Changes to this property will trigger replacement. String
imdsSupport Changes to this property will trigger replacement. String
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernelId Changes to this property will trigger replacement. String
name Changes to this property will trigger replacement. String
Region-unique name for the AMI.
ramdiskId Changes to this property will trigger replacement. String
rootDeviceName Changes to this property will trigger replacement. String
Name of the root device (for example, /dev/sda1, or /dev/xvda).
sriovNetSupport Changes to this property will trigger replacement. String
tags Map<String,String>
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.
tpmSupport Changes to this property will trigger replacement. String
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefiData Changes to this property will trigger replacement. String
Base64 representation of the non-volatile UEFI variable store.
virtualizationType Changes to this property will trigger replacement. String
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.
architecture Changes to this property will trigger replacement. string
Machine architecture for created instances. Defaults to "x86_64".
bootMode Changes to this property will trigger replacement. string
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecationTime string
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)
description string
Longer, human-readable description for the AMI.
ebsBlockDevices AmiEbsBlockDevice[]
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
enaSupport Changes to this property will trigger replacement. boolean
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeralBlockDevices Changes to this property will trigger replacement. AmiEphemeralBlockDevice[]
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
imageLocation Changes to this property will trigger replacement. string
imdsSupport Changes to this property will trigger replacement. string
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernelId Changes to this property will trigger replacement. string
name Changes to this property will trigger replacement. string
Region-unique name for the AMI.
ramdiskId Changes to this property will trigger replacement. string
rootDeviceName Changes to this property will trigger replacement. string
Name of the root device (for example, /dev/sda1, or /dev/xvda).
sriovNetSupport Changes to this property will trigger replacement. string
tags {[key: string]: string}
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.
tpmSupport Changes to this property will trigger replacement. string
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefiData Changes to this property will trigger replacement. string
Base64 representation of the non-volatile UEFI variable store.
virtualizationType Changes to this property will trigger replacement. string
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.
architecture Changes to this property will trigger replacement. str
Machine architecture for created instances. Defaults to "x86_64".
boot_mode Changes to this property will trigger replacement. str
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecation_time str
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)
description str
Longer, human-readable description for the AMI.
ebs_block_devices Sequence[AmiEbsBlockDeviceArgs]
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
ena_support Changes to this property will trigger replacement. bool
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeral_block_devices Changes to this property will trigger replacement. Sequence[AmiEphemeralBlockDeviceArgs]
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
image_location Changes to this property will trigger replacement. str
imds_support Changes to this property will trigger replacement. str
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernel_id Changes to this property will trigger replacement. str
name Changes to this property will trigger replacement. str
Region-unique name for the AMI.
ramdisk_id Changes to this property will trigger replacement. str
root_device_name Changes to this property will trigger replacement. str
Name of the root device (for example, /dev/sda1, or /dev/xvda).
sriov_net_support Changes to this property will trigger replacement. str
tags Mapping[str, str]
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.
tpm_support Changes to this property will trigger replacement. str
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefi_data Changes to this property will trigger replacement. str
Base64 representation of the non-volatile UEFI variable store.
virtualization_type Changes to this property will trigger replacement. str
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.
architecture Changes to this property will trigger replacement. String
Machine architecture for created instances. Defaults to "x86_64".
bootMode Changes to this property will trigger replacement. String
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecationTime String
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)
description String
Longer, human-readable description for the AMI.
ebsBlockDevices List<Property Map>
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
enaSupport Changes to this property will trigger replacement. Boolean
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeralBlockDevices Changes to this property will trigger replacement. List<Property Map>
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
imageLocation Changes to this property will trigger replacement. String
imdsSupport Changes to this property will trigger replacement. String
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernelId Changes to this property will trigger replacement. String
name Changes to this property will trigger replacement. String
Region-unique name for the AMI.
ramdiskId Changes to this property will trigger replacement. String
rootDeviceName Changes to this property will trigger replacement. String
Name of the root device (for example, /dev/sda1, or /dev/xvda).
sriovNetSupport Changes to this property will trigger replacement. String
tags Map<String>
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.
tpmSupport Changes to this property will trigger replacement. String
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefiData Changes to this property will trigger replacement. String
Base64 representation of the non-volatile UEFI variable store.
virtualizationType Changes to this property will trigger replacement. String
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.

Outputs

All input properties are implicitly available as output properties. Additionally, the Ami resource produces the following output properties:

Arn string
ARN of the AMI.
Hypervisor string
Hypervisor type of the image.
Id string
The provider-assigned unique ID for this managed resource.
ImageOwnerAlias string
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageType string
Type of image.
ManageEbsSnapshots bool
OwnerId string
AWS account ID of the image owner.
Platform string
This value is set to windows for Windows AMIs; otherwise, it is blank.
PlatformDetails string
Platform details associated with the billing code of the AMI.
Public bool
Whether the image has public launch permissions.
RootSnapshotId string
Snapshot ID for the root volume (for EBS-backed AMIs)
TagsAll Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

UsageOperation string
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
Arn string
ARN of the AMI.
Hypervisor string
Hypervisor type of the image.
Id string
The provider-assigned unique ID for this managed resource.
ImageOwnerAlias string
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageType string
Type of image.
ManageEbsSnapshots bool
OwnerId string
AWS account ID of the image owner.
Platform string
This value is set to windows for Windows AMIs; otherwise, it is blank.
PlatformDetails string
Platform details associated with the billing code of the AMI.
Public bool
Whether the image has public launch permissions.
RootSnapshotId string
Snapshot ID for the root volume (for EBS-backed AMIs)
TagsAll map[string]string
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

UsageOperation string
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
arn String
ARN of the AMI.
hypervisor String
Hypervisor type of the image.
id String
The provider-assigned unique ID for this managed resource.
imageOwnerAlias String
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
imageType String
Type of image.
manageEbsSnapshots Boolean
ownerId String
AWS account ID of the image owner.
platform String
This value is set to windows for Windows AMIs; otherwise, it is blank.
platformDetails String
Platform details associated with the billing code of the AMI.
public_ Boolean
Whether the image has public launch permissions.
rootSnapshotId String
Snapshot ID for the root volume (for EBS-backed AMIs)
tagsAll Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

usageOperation String
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
arn string
ARN of the AMI.
hypervisor string
Hypervisor type of the image.
id string
The provider-assigned unique ID for this managed resource.
imageOwnerAlias string
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
imageType string
Type of image.
manageEbsSnapshots boolean
ownerId string
AWS account ID of the image owner.
platform string
This value is set to windows for Windows AMIs; otherwise, it is blank.
platformDetails string
Platform details associated with the billing code of the AMI.
public boolean
Whether the image has public launch permissions.
rootSnapshotId string
Snapshot ID for the root volume (for EBS-backed AMIs)
tagsAll {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

usageOperation string
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
arn str
ARN of the AMI.
hypervisor str
Hypervisor type of the image.
id str
The provider-assigned unique ID for this managed resource.
image_owner_alias str
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
image_type str
Type of image.
manage_ebs_snapshots bool
owner_id str
AWS account ID of the image owner.
platform str
This value is set to windows for Windows AMIs; otherwise, it is blank.
platform_details str
Platform details associated with the billing code of the AMI.
public bool
Whether the image has public launch permissions.
root_snapshot_id str
Snapshot ID for the root volume (for EBS-backed AMIs)
tags_all Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

usage_operation str
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
arn String
ARN of the AMI.
hypervisor String
Hypervisor type of the image.
id String
The provider-assigned unique ID for this managed resource.
imageOwnerAlias String
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
imageType String
Type of image.
manageEbsSnapshots Boolean
ownerId String
AWS account ID of the image owner.
platform String
This value is set to windows for Windows AMIs; otherwise, it is blank.
platformDetails String
Platform details associated with the billing code of the AMI.
public Boolean
Whether the image has public launch permissions.
rootSnapshotId String
Snapshot ID for the root volume (for EBS-backed AMIs)
tagsAll Map<String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

usageOperation String
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.

Look up Existing Ami Resource

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

public static get(name: string, id: Input<ID>, state?: AmiState, opts?: CustomResourceOptions): Ami
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        architecture: Optional[str] = None,
        arn: Optional[str] = None,
        boot_mode: Optional[str] = None,
        deprecation_time: Optional[str] = None,
        description: Optional[str] = None,
        ebs_block_devices: Optional[Sequence[AmiEbsBlockDeviceArgs]] = None,
        ena_support: Optional[bool] = None,
        ephemeral_block_devices: Optional[Sequence[AmiEphemeralBlockDeviceArgs]] = None,
        hypervisor: Optional[str] = None,
        image_location: Optional[str] = None,
        image_owner_alias: Optional[str] = None,
        image_type: Optional[str] = None,
        imds_support: Optional[str] = None,
        kernel_id: Optional[str] = None,
        manage_ebs_snapshots: Optional[bool] = None,
        name: Optional[str] = None,
        owner_id: Optional[str] = None,
        platform: Optional[str] = None,
        platform_details: Optional[str] = None,
        public: Optional[bool] = None,
        ramdisk_id: Optional[str] = None,
        root_device_name: Optional[str] = None,
        root_snapshot_id: Optional[str] = None,
        sriov_net_support: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        tpm_support: Optional[str] = None,
        uefi_data: Optional[str] = None,
        usage_operation: Optional[str] = None,
        virtualization_type: Optional[str] = None) -> Ami
func GetAmi(ctx *Context, name string, id IDInput, state *AmiState, opts ...ResourceOption) (*Ami, error)
public static Ami Get(string name, Input<string> id, AmiState? state, CustomResourceOptions? opts = null)
public static Ami get(String name, Output<String> id, AmiState state, CustomResourceOptions options)
resources:  _:    type: aws:ec2:Ami    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Architecture Changes to this property will trigger replacement. string
Machine architecture for created instances. Defaults to "x86_64".
Arn string
ARN of the AMI.
BootMode Changes to this property will trigger replacement. string
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
DeprecationTime string
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)
Description string
Longer, human-readable description for the AMI.
EbsBlockDevices List<AmiEbsBlockDevice>
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
EnaSupport Changes to this property will trigger replacement. bool
Whether enhanced networking with ENA is enabled. Defaults to false.
EphemeralBlockDevices Changes to this property will trigger replacement. List<AmiEphemeralBlockDevice>
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
Hypervisor string
Hypervisor type of the image.
ImageLocation Changes to this property will trigger replacement. string
ImageOwnerAlias string
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageType string
Type of image.
ImdsSupport Changes to this property will trigger replacement. string
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
KernelId Changes to this property will trigger replacement. string
ManageEbsSnapshots bool
Name Changes to this property will trigger replacement. string
Region-unique name for the AMI.
OwnerId string
AWS account ID of the image owner.
Platform string
This value is set to windows for Windows AMIs; otherwise, it is blank.
PlatformDetails string
Platform details associated with the billing code of the AMI.
Public bool
Whether the image has public launch permissions.
RamdiskId Changes to this property will trigger replacement. string
RootDeviceName Changes to this property will trigger replacement. string
Name of the root device (for example, /dev/sda1, or /dev/xvda).
RootSnapshotId string
Snapshot ID for the root volume (for EBS-backed AMIs)
SriovNetSupport Changes to this property will trigger replacement. string
Tags Dictionary<string, string>
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.
TagsAll Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TpmSupport Changes to this property will trigger replacement. string
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
UefiData Changes to this property will trigger replacement. string
Base64 representation of the non-volatile UEFI variable store.
UsageOperation string
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
VirtualizationType Changes to this property will trigger replacement. string
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.
Architecture Changes to this property will trigger replacement. string
Machine architecture for created instances. Defaults to "x86_64".
Arn string
ARN of the AMI.
BootMode Changes to this property will trigger replacement. string
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
DeprecationTime string
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)
Description string
Longer, human-readable description for the AMI.
EbsBlockDevices []AmiEbsBlockDeviceArgs
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
EnaSupport Changes to this property will trigger replacement. bool
Whether enhanced networking with ENA is enabled. Defaults to false.
EphemeralBlockDevices Changes to this property will trigger replacement. []AmiEphemeralBlockDeviceArgs
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
Hypervisor string
Hypervisor type of the image.
ImageLocation Changes to this property will trigger replacement. string
ImageOwnerAlias string
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
ImageType string
Type of image.
ImdsSupport Changes to this property will trigger replacement. string
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
KernelId Changes to this property will trigger replacement. string
ManageEbsSnapshots bool
Name Changes to this property will trigger replacement. string
Region-unique name for the AMI.
OwnerId string
AWS account ID of the image owner.
Platform string
This value is set to windows for Windows AMIs; otherwise, it is blank.
PlatformDetails string
Platform details associated with the billing code of the AMI.
Public bool
Whether the image has public launch permissions.
RamdiskId Changes to this property will trigger replacement. string
RootDeviceName Changes to this property will trigger replacement. string
Name of the root device (for example, /dev/sda1, or /dev/xvda).
RootSnapshotId string
Snapshot ID for the root volume (for EBS-backed AMIs)
SriovNetSupport Changes to this property will trigger replacement. string
Tags map[string]string
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.
TagsAll map[string]string
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TpmSupport Changes to this property will trigger replacement. string
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
UefiData Changes to this property will trigger replacement. string
Base64 representation of the non-volatile UEFI variable store.
UsageOperation string
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
VirtualizationType Changes to this property will trigger replacement. string
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.
architecture Changes to this property will trigger replacement. String
Machine architecture for created instances. Defaults to "x86_64".
arn String
ARN of the AMI.
bootMode Changes to this property will trigger replacement. String
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecationTime String
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)
description String
Longer, human-readable description for the AMI.
ebsBlockDevices List<AmiEbsBlockDevice>
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
enaSupport Changes to this property will trigger replacement. Boolean
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeralBlockDevices Changes to this property will trigger replacement. List<AmiEphemeralBlockDevice>
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
hypervisor String
Hypervisor type of the image.
imageLocation Changes to this property will trigger replacement. String
imageOwnerAlias String
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
imageType String
Type of image.
imdsSupport Changes to this property will trigger replacement. String
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernelId Changes to this property will trigger replacement. String
manageEbsSnapshots Boolean
name Changes to this property will trigger replacement. String
Region-unique name for the AMI.
ownerId String
AWS account ID of the image owner.
platform String
This value is set to windows for Windows AMIs; otherwise, it is blank.
platformDetails String
Platform details associated with the billing code of the AMI.
public_ Boolean
Whether the image has public launch permissions.
ramdiskId Changes to this property will trigger replacement. String
rootDeviceName Changes to this property will trigger replacement. String
Name of the root device (for example, /dev/sda1, or /dev/xvda).
rootSnapshotId String
Snapshot ID for the root volume (for EBS-backed AMIs)
sriovNetSupport Changes to this property will trigger replacement. String
tags Map<String,String>
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.
tagsAll Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

tpmSupport Changes to this property will trigger replacement. String
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefiData Changes to this property will trigger replacement. String
Base64 representation of the non-volatile UEFI variable store.
usageOperation String
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
virtualizationType Changes to this property will trigger replacement. String
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.
architecture Changes to this property will trigger replacement. string
Machine architecture for created instances. Defaults to "x86_64".
arn string
ARN of the AMI.
bootMode Changes to this property will trigger replacement. string
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecationTime string
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)
description string
Longer, human-readable description for the AMI.
ebsBlockDevices AmiEbsBlockDevice[]
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
enaSupport Changes to this property will trigger replacement. boolean
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeralBlockDevices Changes to this property will trigger replacement. AmiEphemeralBlockDevice[]
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
hypervisor string
Hypervisor type of the image.
imageLocation Changes to this property will trigger replacement. string
imageOwnerAlias string
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
imageType string
Type of image.
imdsSupport Changes to this property will trigger replacement. string
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernelId Changes to this property will trigger replacement. string
manageEbsSnapshots boolean
name Changes to this property will trigger replacement. string
Region-unique name for the AMI.
ownerId string
AWS account ID of the image owner.
platform string
This value is set to windows for Windows AMIs; otherwise, it is blank.
platformDetails string
Platform details associated with the billing code of the AMI.
public boolean
Whether the image has public launch permissions.
ramdiskId Changes to this property will trigger replacement. string
rootDeviceName Changes to this property will trigger replacement. string
Name of the root device (for example, /dev/sda1, or /dev/xvda).
rootSnapshotId string
Snapshot ID for the root volume (for EBS-backed AMIs)
sriovNetSupport Changes to this property will trigger replacement. string
tags {[key: string]: string}
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.
tagsAll {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

tpmSupport Changes to this property will trigger replacement. string
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefiData Changes to this property will trigger replacement. string
Base64 representation of the non-volatile UEFI variable store.
usageOperation string
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
virtualizationType Changes to this property will trigger replacement. string
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.
architecture Changes to this property will trigger replacement. str
Machine architecture for created instances. Defaults to "x86_64".
arn str
ARN of the AMI.
boot_mode Changes to this property will trigger replacement. str
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecation_time str
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)
description str
Longer, human-readable description for the AMI.
ebs_block_devices Sequence[AmiEbsBlockDeviceArgs]
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
ena_support Changes to this property will trigger replacement. bool
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeral_block_devices Changes to this property will trigger replacement. Sequence[AmiEphemeralBlockDeviceArgs]
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
hypervisor str
Hypervisor type of the image.
image_location Changes to this property will trigger replacement. str
image_owner_alias str
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
image_type str
Type of image.
imds_support Changes to this property will trigger replacement. str
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernel_id Changes to this property will trigger replacement. str
manage_ebs_snapshots bool
name Changes to this property will trigger replacement. str
Region-unique name for the AMI.
owner_id str
AWS account ID of the image owner.
platform str
This value is set to windows for Windows AMIs; otherwise, it is blank.
platform_details str
Platform details associated with the billing code of the AMI.
public bool
Whether the image has public launch permissions.
ramdisk_id Changes to this property will trigger replacement. str
root_device_name Changes to this property will trigger replacement. str
Name of the root device (for example, /dev/sda1, or /dev/xvda).
root_snapshot_id str
Snapshot ID for the root volume (for EBS-backed AMIs)
sriov_net_support Changes to this property will trigger replacement. str
tags Mapping[str, str]
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.
tags_all Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

tpm_support Changes to this property will trigger replacement. str
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefi_data Changes to this property will trigger replacement. str
Base64 representation of the non-volatile UEFI variable store.
usage_operation str
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
virtualization_type Changes to this property will trigger replacement. str
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.
architecture Changes to this property will trigger replacement. String
Machine architecture for created instances. Defaults to "x86_64".
arn String
ARN of the AMI.
bootMode Changes to this property will trigger replacement. String
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
deprecationTime String
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)
description String
Longer, human-readable description for the AMI.
ebsBlockDevices List<Property Map>
Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
enaSupport Changes to this property will trigger replacement. Boolean
Whether enhanced networking with ENA is enabled. Defaults to false.
ephemeralBlockDevices Changes to this property will trigger replacement. List<Property Map>
Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
hypervisor String
Hypervisor type of the image.
imageLocation Changes to this property will trigger replacement. String
imageOwnerAlias String
AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
imageType String
Type of image.
imdsSupport Changes to this property will trigger replacement. String
If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to v2.0. For more information, see Configure instance metadata options for new instances.
kernelId Changes to this property will trigger replacement. String
manageEbsSnapshots Boolean
name Changes to this property will trigger replacement. String
Region-unique name for the AMI.
ownerId String
AWS account ID of the image owner.
platform String
This value is set to windows for Windows AMIs; otherwise, it is blank.
platformDetails String
Platform details associated with the billing code of the AMI.
public Boolean
Whether the image has public launch permissions.
ramdiskId Changes to this property will trigger replacement. String
rootDeviceName Changes to this property will trigger replacement. String
Name of the root device (for example, /dev/sda1, or /dev/xvda).
rootSnapshotId String
Snapshot ID for the root volume (for EBS-backed AMIs)
sriovNetSupport Changes to this property will trigger replacement. String
tags Map<String>
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.
tagsAll Map<String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

tpmSupport Changes to this property will trigger replacement. String
If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon Elastic Compute Cloud User Guide.
uefiData Changes to this property will trigger replacement. String
Base64 representation of the non-volatile UEFI variable store.
usageOperation String
Operation of the Amazon EC2 instance and the billing code that is associated with the AMI.
virtualizationType Changes to this property will trigger replacement. String
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.

Supporting Types

AmiEbsBlockDevice
, AmiEbsBlockDeviceArgs

DeviceName
This property is required.
Changes to this property will trigger replacement.
string
Path at which the device is exposed to created instances.
DeleteOnTermination Changes to this property will trigger replacement. bool
Boolean controlling whether the EBS volumes created to support each created instance will be deleted once that instance is terminated.
Encrypted Changes to this property will trigger replacement. bool
Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.
Iops Changes to this property will trigger replacement. int
Number of I/O operations per second the created volumes will support.
OutpostArn Changes to this property will trigger replacement. string

ARN of the Outpost on which the snapshot is stored.

Note: You can specify encrypted or snapshot_id but not both.

SnapshotId Changes to this property will trigger replacement. string
ID of an EBS snapshot that will be used to initialize the created EBS volumes. If set, the volume_size attribute must be at least as large as the referenced snapshot.
Throughput Changes to this property will trigger replacement. int
Throughput that the EBS volume supports, in MiB/s. Only valid for volume_type of gp3.
VolumeSize Changes to this property will trigger replacement. int
Size of created volumes in GiB. If snapshot_id is set and volume_size is omitted then the volume will have the same size as the selected snapshot.
VolumeType Changes to this property will trigger replacement. string
Type of EBS volume to create. Can be standard, gp2, gp3, io1, io2, sc1 or st1 (Default: standard).
DeviceName
This property is required.
Changes to this property will trigger replacement.
string
Path at which the device is exposed to created instances.
DeleteOnTermination Changes to this property will trigger replacement. bool
Boolean controlling whether the EBS volumes created to support each created instance will be deleted once that instance is terminated.
Encrypted Changes to this property will trigger replacement. bool
Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.
Iops Changes to this property will trigger replacement. int
Number of I/O operations per second the created volumes will support.
OutpostArn Changes to this property will trigger replacement. string

ARN of the Outpost on which the snapshot is stored.

Note: You can specify encrypted or snapshot_id but not both.

SnapshotId Changes to this property will trigger replacement. string
ID of an EBS snapshot that will be used to initialize the created EBS volumes. If set, the volume_size attribute must be at least as large as the referenced snapshot.
Throughput Changes to this property will trigger replacement. int
Throughput that the EBS volume supports, in MiB/s. Only valid for volume_type of gp3.
VolumeSize Changes to this property will trigger replacement. int
Size of created volumes in GiB. If snapshot_id is set and volume_size is omitted then the volume will have the same size as the selected snapshot.
VolumeType Changes to this property will trigger replacement. string
Type of EBS volume to create. Can be standard, gp2, gp3, io1, io2, sc1 or st1 (Default: standard).
deviceName
This property is required.
Changes to this property will trigger replacement.
String
Path at which the device is exposed to created instances.
deleteOnTermination Changes to this property will trigger replacement. Boolean
Boolean controlling whether the EBS volumes created to support each created instance will be deleted once that instance is terminated.
encrypted Changes to this property will trigger replacement. Boolean
Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.
iops Changes to this property will trigger replacement. Integer
Number of I/O operations per second the created volumes will support.
outpostArn Changes to this property will trigger replacement. String

ARN of the Outpost on which the snapshot is stored.

Note: You can specify encrypted or snapshot_id but not both.

snapshotId Changes to this property will trigger replacement. String
ID of an EBS snapshot that will be used to initialize the created EBS volumes. If set, the volume_size attribute must be at least as large as the referenced snapshot.
throughput Changes to this property will trigger replacement. Integer
Throughput that the EBS volume supports, in MiB/s. Only valid for volume_type of gp3.
volumeSize Changes to this property will trigger replacement. Integer
Size of created volumes in GiB. If snapshot_id is set and volume_size is omitted then the volume will have the same size as the selected snapshot.
volumeType Changes to this property will trigger replacement. String
Type of EBS volume to create. Can be standard, gp2, gp3, io1, io2, sc1 or st1 (Default: standard).
deviceName
This property is required.
Changes to this property will trigger replacement.
string
Path at which the device is exposed to created instances.
deleteOnTermination Changes to this property will trigger replacement. boolean
Boolean controlling whether the EBS volumes created to support each created instance will be deleted once that instance is terminated.
encrypted Changes to this property will trigger replacement. boolean
Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.
iops Changes to this property will trigger replacement. number
Number of I/O operations per second the created volumes will support.
outpostArn Changes to this property will trigger replacement. string

ARN of the Outpost on which the snapshot is stored.

Note: You can specify encrypted or snapshot_id but not both.

snapshotId Changes to this property will trigger replacement. string
ID of an EBS snapshot that will be used to initialize the created EBS volumes. If set, the volume_size attribute must be at least as large as the referenced snapshot.
throughput Changes to this property will trigger replacement. number
Throughput that the EBS volume supports, in MiB/s. Only valid for volume_type of gp3.
volumeSize Changes to this property will trigger replacement. number
Size of created volumes in GiB. If snapshot_id is set and volume_size is omitted then the volume will have the same size as the selected snapshot.
volumeType Changes to this property will trigger replacement. string
Type of EBS volume to create. Can be standard, gp2, gp3, io1, io2, sc1 or st1 (Default: standard).
device_name
This property is required.
Changes to this property will trigger replacement.
str
Path at which the device is exposed to created instances.
delete_on_termination Changes to this property will trigger replacement. bool
Boolean controlling whether the EBS volumes created to support each created instance will be deleted once that instance is terminated.
encrypted Changes to this property will trigger replacement. bool
Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.
iops Changes to this property will trigger replacement. int
Number of I/O operations per second the created volumes will support.
outpost_arn Changes to this property will trigger replacement. str

ARN of the Outpost on which the snapshot is stored.

Note: You can specify encrypted or snapshot_id but not both.

snapshot_id Changes to this property will trigger replacement. str
ID of an EBS snapshot that will be used to initialize the created EBS volumes. If set, the volume_size attribute must be at least as large as the referenced snapshot.
throughput Changes to this property will trigger replacement. int
Throughput that the EBS volume supports, in MiB/s. Only valid for volume_type of gp3.
volume_size Changes to this property will trigger replacement. int
Size of created volumes in GiB. If snapshot_id is set and volume_size is omitted then the volume will have the same size as the selected snapshot.
volume_type Changes to this property will trigger replacement. str
Type of EBS volume to create. Can be standard, gp2, gp3, io1, io2, sc1 or st1 (Default: standard).
deviceName
This property is required.
Changes to this property will trigger replacement.
String
Path at which the device is exposed to created instances.
deleteOnTermination Changes to this property will trigger replacement. Boolean
Boolean controlling whether the EBS volumes created to support each created instance will be deleted once that instance is terminated.
encrypted Changes to this property will trigger replacement. Boolean
Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.
iops Changes to this property will trigger replacement. Number
Number of I/O operations per second the created volumes will support.
outpostArn Changes to this property will trigger replacement. String

ARN of the Outpost on which the snapshot is stored.

Note: You can specify encrypted or snapshot_id but not both.

snapshotId Changes to this property will trigger replacement. String
ID of an EBS snapshot that will be used to initialize the created EBS volumes. If set, the volume_size attribute must be at least as large as the referenced snapshot.
throughput Changes to this property will trigger replacement. Number
Throughput that the EBS volume supports, in MiB/s. Only valid for volume_type of gp3.
volumeSize Changes to this property will trigger replacement. Number
Size of created volumes in GiB. If snapshot_id is set and volume_size is omitted then the volume will have the same size as the selected snapshot.
volumeType Changes to this property will trigger replacement. String
Type of EBS volume to create. Can be standard, gp2, gp3, io1, io2, sc1 or st1 (Default: standard).

AmiEphemeralBlockDevice
, AmiEphemeralBlockDeviceArgs

DeviceName This property is required. string
Path at which the device is exposed to created instances.
VirtualName This property is required. string
Name for the ephemeral device, of the form "ephemeralN" where N is a volume number starting from zero.
DeviceName This property is required. string
Path at which the device is exposed to created instances.
VirtualName This property is required. string
Name for the ephemeral device, of the form "ephemeralN" where N is a volume number starting from zero.
deviceName This property is required. String
Path at which the device is exposed to created instances.
virtualName This property is required. String
Name for the ephemeral device, of the form "ephemeralN" where N is a volume number starting from zero.
deviceName This property is required. string
Path at which the device is exposed to created instances.
virtualName This property is required. string
Name for the ephemeral device, of the form "ephemeralN" where N is a volume number starting from zero.
device_name This property is required. str
Path at which the device is exposed to created instances.
virtual_name This property is required. str
Name for the ephemeral device, of the form "ephemeralN" where N is a volume number starting from zero.
deviceName This property is required. String
Path at which the device is exposed to created instances.
virtualName This property is required. String
Name for the ephemeral device, of the form "ephemeralN" where N is a volume number starting from zero.

Import

Using pulumi import, import aws_ami using the ID of the AMI. For example:

$ pulumi import aws:ec2/ami:Ami example ami-12345678
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.