pulumi_wasm_providers_aws_mini::ec2

Module ami

source
Expand description

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

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let example = ami::create(
        "example",
        AmiArgs::builder()
            .ebs_block_devices(
                vec![
                    AmiEbsBlockDevice::builder().deviceName("/dev/xvda")
                    .snapshotId("snap-xxxxxxxx").volumeSize(8).build_struct(),
                ],
            )
            .imds_support("v2.0")
            .name("example")
            .root_device_name("/dev/xvda")
            .virtualization_type("hvm")
            .build_struct(),
    );
}

§Import

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

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

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments