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" },
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class AmiCopy : CustomResource
Constructors
View SourceAmiCopy(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 SourceArchitecture
Machine architecture for created instances. Defaults to "x86_64".
Declaration
public Output<string> Architecture { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A longer, human-readable description for the AMI.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
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> |
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>> |
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>> |
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> |
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> |
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> |
ManageEbsSnapshots
Declaration
public Output<bool> ManageEbsSnapshots { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Name
A region-unique name for the AMI.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
RootSnapshotId
Declaration
public Output<string> RootSnapshotId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
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> |
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>> |
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 SourceGet(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 |