AmiCopy

class AmiCopy : KotlinCustomResource

The "AMI copy" resource allows duplication of an Amazon Machine Image (AMI), including cross-region copies. If the source AMI has associated EBS snapshots, those will also be duplicated along with the AMI. This is useful for taking a single AMI provisioned in one region and making it available in another for a multi-region deployment. Copying an AMI can take several minutes. The creation of this resource will block until the new AMI is available for use on new instances.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.AmiCopy;
import com.pulumi.aws.ec2.AmiCopyArgs;
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 AmiCopy("example", AmiCopyArgs.builder()
.description("A copy of ami-xxxxxxxx")
.sourceAmiId("ami-xxxxxxxx")
.sourceAmiRegion("us-west-1")
.tags(Map.of("Name", "HelloWorld"))
.build());
}
}

Properties

Link copied to clipboard
val architecture: Output<String>

Machine architecture for created instances. Defaults to "x86_64".

Link copied to clipboard
val arn: Output<String>

ARN of the AMI.

Link copied to clipboard
val bootMode: Output<String>

Boot mode of the AMI. For more information, see Boot modes in the Amazon Elastic Compute Cloud User Guide.

Link copied to clipboard
val deprecationTime: Output<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)

Link copied to clipboard
val description: Output<String>?

Longer, human-readable description for the AMI.

Link copied to clipboard

ARN of the Outpost to which to copy the AMI. Only specify this parameter when copying an AMI from an AWS Region to an Outpost. The AMI must be in the Region of the destination Outpost.

Link copied to clipboard

Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.

Link copied to clipboard
val enaSupport: Output<Boolean>

Whether enhanced networking with ENA is enabled. Defaults to false.

Link copied to clipboard
val encrypted: Output<Boolean>?

Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with snapshot_id.

Link copied to clipboard

Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.

Link copied to clipboard
val hypervisor: Output<String>
Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageLocation: Output<String>

Path to an S3 object containing an image manifest, e.g., created by the ec2-upload-bundle command in the EC2 command line tools.

Link copied to clipboard
val imageOwnerAlias: Output<String>
Link copied to clipboard
val imageType: Output<String>
Link copied to clipboard
val imdsSupport: Output<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.

Link copied to clipboard
val kernelId: Output<String>

ID of the kernel image (AKI) that will be used as the paravirtual kernel in created instances.

Link copied to clipboard
val kmsKeyId: Output<String>

Full ARN of the KMS Key to use when encrypting the snapshots of an image during a copy operation. If not specified, then the default AWS KMS Key will be used

Link copied to clipboard
Link copied to clipboard
val name: Output<String>

Region-unique name for the AMI.

Link copied to clipboard
val ownerId: Output<String>
Link copied to clipboard
val platform: Output<String>
Link copied to clipboard
val platformDetails: Output<String>
Link copied to clipboard
val public: Output<Boolean>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ramdiskId: Output<String>

ID of an initrd image (ARI) that will be used when booting the created instances.

Link copied to clipboard
val rootDeviceName: Output<String>

Name of the root device (for example, /dev/sda1, or /dev/xvda).

Link copied to clipboard
val rootSnapshotId: Output<String>
Link copied to clipboard
val sourceAmiId: Output<String>

Id of the AMI to copy. This id must be valid in the region given by source_ami_region.

Link copied to clipboard
val sourceAmiRegion: Output<String>

Region from which the AMI will be copied. This may be the same as the AWS provider region in order to create a copy within the same region.

Link copied to clipboard
val sriovNetSupport: Output<String>

When set to "simple" (the default), enables enhanced networking for created instances. No other value is supported at this time.

Link copied to clipboard
val tags: Output<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.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>
Link copied to clipboard
val tpmSupport: Output<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.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val usageOperation: Output<String>
Link copied to clipboard

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.