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§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments