Class AmiCopy


  • public class AmiCopy
    extends com.pulumi.resources.CustomResource
    The "AMI copy" resource allows duplication of an 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.ArrayList;
     import java.util.Arrays;
     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()
                 .name("example")
                 .sourceAmiId("ami-xxxxxxxx")
                 .sourceAmiRegion("us-west-1")
                 .tags(Map.of("Name", "HelloWorld"))
                 .build());
     
         }
     }
     
     
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      AmiCopy​(java.lang.String name)  
      AmiCopy​(java.lang.String name, AmiCopyArgs args)  
      AmiCopy​(java.lang.String name, AmiCopyArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> architecture()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> bootMode()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> deprecationTime()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationOutpostArn()  
      com.pulumi.core.Output<java.util.List<AmiCopyEbsBlockDevice>> ebsBlockDevices()  
      com.pulumi.core.Output<java.lang.Boolean> enaSupport()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> encrypted()  
      com.pulumi.core.Output<java.util.List<AmiCopyEphemeralBlockDevice>> ephemeralBlockDevices()  
      static AmiCopy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, AmiCopyState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> hypervisor()  
      com.pulumi.core.Output<java.lang.String> imageLocation()  
      com.pulumi.core.Output<java.lang.String> imageOwnerAlias()  
      com.pulumi.core.Output<java.lang.String> imageType()  
      com.pulumi.core.Output<java.lang.String> imdsSupport()  
      com.pulumi.core.Output<java.lang.String> kernelId()  
      com.pulumi.core.Output<java.lang.String> kmsKeyId()  
      com.pulumi.core.Output<java.lang.String> lastLaunchedTime()  
      com.pulumi.core.Output<java.lang.Boolean> manageEbsSnapshots()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> ownerId()  
      com.pulumi.core.Output<java.lang.String> platform()  
      com.pulumi.core.Output<java.lang.String> platformDetails()  
      com.pulumi.core.Output<java.lang.Boolean> public_()  
      com.pulumi.core.Output<java.lang.String> ramdiskId()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> rootDeviceName()  
      com.pulumi.core.Output<java.lang.String> rootSnapshotId()  
      com.pulumi.core.Output<java.lang.String> sourceAmiId()  
      com.pulumi.core.Output<java.lang.String> sourceAmiRegion()  
      com.pulumi.core.Output<java.lang.String> sriovNetSupport()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> tpmSupport()  
      com.pulumi.core.Output<java.lang.String> uefiData()  
      com.pulumi.core.Output<java.lang.String> usageOperation()  
      com.pulumi.core.Output<java.lang.String> virtualizationType()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AmiCopy

        public AmiCopy​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • AmiCopy

        public AmiCopy​(java.lang.String name,
                       AmiCopyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • AmiCopy

        public AmiCopy​(java.lang.String name,
                       AmiCopyArgs args,
                       @Nullable
                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • architecture

        public com.pulumi.core.Output<java.lang.String> architecture()
        Returns:
        Machine architecture for created instances. Defaults to `x8664`.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the AMI.
      • bootMode

        public com.pulumi.core.Output<java.lang.String> bootMode()
        Returns:
        Boot mode of the AMI. For more information, see [Boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) in the EC2 User Guide.
      • deprecationTime

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> deprecationTime()
        Returns:
        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](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`)
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Longer, human-readable description for the AMI.
      • destinationOutpostArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> destinationOutpostArn()
        Returns:
        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.
      • ebsBlockDevices

        public com.pulumi.core.Output<java.util.List<AmiCopyEbsBlockDevice>> ebsBlockDevices()
        Returns:
        Nested block describing an EBS block device that should be attached to created instances. The structure of this block is described below.
      • enaSupport

        public com.pulumi.core.Output<java.lang.Boolean> enaSupport()
        Returns:
        Whether enhanced networking with ENA is enabled. Defaults to `false`.
      • encrypted

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> encrypted()
        Returns:
        Whether the destination snapshots of the copied image should be encrypted. Defaults to `false`
      • ephemeralBlockDevices

        public com.pulumi.core.Output<java.util.List<AmiCopyEphemeralBlockDevice>> ephemeralBlockDevices()
        Returns:
        Nested block describing an ephemeral block device that should be attached to created instances. The structure of this block is described below.
      • hypervisor

        public com.pulumi.core.Output<java.lang.String> hypervisor()
      • imageLocation

        public com.pulumi.core.Output<java.lang.String> imageLocation()
        Returns:
        Path to an S3 object containing an image manifest, e.g., created by the `ec2-upload-bundle` command in the EC2 command line tools.
      • imageOwnerAlias

        public com.pulumi.core.Output<java.lang.String> imageOwnerAlias()
      • imageType

        public com.pulumi.core.Output<java.lang.String> imageType()
      • imdsSupport

        public com.pulumi.core.Output<java.lang.String> imdsSupport()
        Returns:
        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](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration).
      • kernelId

        public com.pulumi.core.Output<java.lang.String> kernelId()
        Returns:
        ID of the kernel image (AKI) that will be used as the paravirtual kernel in created instances.
      • kmsKeyId

        public com.pulumi.core.Output<java.lang.String> kmsKeyId()
        Returns:
        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
      • lastLaunchedTime

        public com.pulumi.core.Output<java.lang.String> lastLaunchedTime()
      • manageEbsSnapshots

        public com.pulumi.core.Output<java.lang.Boolean> manageEbsSnapshots()
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Region-unique name for the AMI.
      • ownerId

        public com.pulumi.core.Output<java.lang.String> ownerId()
      • platform

        public com.pulumi.core.Output<java.lang.String> platform()
      • platformDetails

        public com.pulumi.core.Output<java.lang.String> platformDetails()
      • public_

        public com.pulumi.core.Output<java.lang.Boolean> public_()
      • ramdiskId

        public com.pulumi.core.Output<java.lang.String> ramdiskId()
        Returns:
        ID of an initrd image (ARI) that will be used when booting the created instances.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • rootDeviceName

        public com.pulumi.core.Output<java.lang.String> rootDeviceName()
        Returns:
        Name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
      • rootSnapshotId

        public com.pulumi.core.Output<java.lang.String> rootSnapshotId()
      • sourceAmiId

        public com.pulumi.core.Output<java.lang.String> sourceAmiId()
        Returns:
        ID of the AMI to copy. This ID must be valid in the region given by `sourceAmiRegion`.
      • sourceAmiRegion

        public com.pulumi.core.Output<java.lang.String> sourceAmiRegion()
        Returns:
        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.
      • sriovNetSupport

        public com.pulumi.core.Output<java.lang.String> sriovNetSupport()
        Returns:
        When set to "simple" (the default), enables enhanced networking for created instances. No other value is supported at this time.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
      • tpmSupport

        public com.pulumi.core.Output<java.lang.String> tpmSupport()
        Returns:
        If the image is configured for NitroTPM support, the value is `v2.0`. For more information, see [NitroTPM](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html) in the EC2 User Guide.
      • uefiData

        public com.pulumi.core.Output<java.lang.String> uefiData()
        Returns:
        Base64 representation of the non-volatile UEFI variable store.
      • usageOperation

        public com.pulumi.core.Output<java.lang.String> usageOperation()
      • virtualizationType

        public com.pulumi.core.Output<java.lang.String> virtualizationType()
        Returns:
        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.
      • get

        public static AmiCopy get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  AmiCopyState state,
                                  @Nullable
                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.