Show / Hide Table of Contents

Class AmiCopy

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.Ec2.AmiCopy("example", new Aws.Ec2.AmiCopyArgs
    {
        Description = "A copy of ami-xxxxxxxx",
        SourceAmiId = "ami-xxxxxxxx",
        SourceAmiRegion = "us-west-1",
        Tags = 
        {
            { "Name", "HelloWorld" },
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
AmiCopy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class AmiCopy : CustomResource

Constructors

View Source

AmiCopy(String, AmiCopyArgs, CustomResourceOptions)

Create a AmiCopy resource with the given unique name, arguments, and options.

Declaration
public AmiCopy(string name, AmiCopyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

AmiCopyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Architecture

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

Declaration
public Output<string> Architecture { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

A longer, human-readable description for the AMI.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

EbsBlockDevices

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

Declaration
public Output<ImmutableArray<AmiCopyEbsBlockDevice>> EbsBlockDevices { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<AmiCopyEbsBlockDevice>>
View Source

EnaSupport

Specifies whether enhanced networking with ENA is enabled. Defaults to false.

Declaration
public Output<bool> EnaSupport { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Encrypted

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

Declaration
public Output<bool?> Encrypted { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

EphemeralBlockDevices

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

Declaration
public Output<ImmutableArray<AmiCopyEphemeralBlockDevice>> EphemeralBlockDevices { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<AmiCopyEphemeralBlockDevice>>
View Source

ImageLocation

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

Declaration
public Output<string> ImageLocation { get; }
Property Value
Type Description
Output<System.String>
View Source

KernelId

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

Declaration
public Output<string> KernelId { get; }
Property Value
Type Description
Output<System.String>
View Source

KmsKeyId

The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when encrypting the snapshots of an image during a copy operation. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used

Declaration
public Output<string> KmsKeyId { get; }
Property Value
Type Description
Output<System.String>
View Source

ManageEbsSnapshots

Declaration
public Output<bool> ManageEbsSnapshots { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Name

A region-unique name for the AMI.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

RamdiskId

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

Declaration
public Output<string> RamdiskId { get; }
Property Value
Type Description
Output<System.String>
View Source

RootDeviceName

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

Declaration
public Output<string> RootDeviceName { get; }
Property Value
Type Description
Output<System.String>
View Source

RootSnapshotId

Declaration
public Output<string> RootSnapshotId { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceAmiId

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

Declaration
public Output<string> SourceAmiId { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceAmiRegion

The 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.

Declaration
public Output<string> SourceAmiRegion { get; }
Property Value
Type Description
Output<System.String>
View Source

SriovNetSupport

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

Declaration
public Output<string> SriovNetSupport { get; }
Property Value
Type Description
Output<System.String>
View Source

Tags

A map of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VirtualizationType

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.

Declaration
public Output<string> VirtualizationType { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, AmiCopyState, CustomResourceOptions)

Get an existing AmiCopy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static AmiCopy Get(string name, Input<string> id, AmiCopyState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

AmiCopyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
AmiCopy
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.