Ami Args
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
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) {
var example = new Ami("example", AmiArgs.builder()
.ebsBlockDevices(AmiEbsBlockDeviceArgs.builder()
.deviceName("/dev/xvda")
.snapshotId("snap-xxxxxxxx")
.volumeSize(8)
.build())
.imdsSupport("v2.0")
.rootDeviceName("/dev/xvda")
.virtualizationType("hvm")
.build());
}
}
Import
aws_ami
can be imported using the ID of the AMI, e.g.,
$ pulumi import aws:ec2/ami:Ami example ami-12345678
Constructors
Functions
Properties
Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.
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
)
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.
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.