AmiCopyArgs

data class AmiCopyArgs(val deprecationTime: Output<String>? = null, val description: Output<String>? = null, val destinationOutpostArn: Output<String>? = null, val ebsBlockDevices: Output<List<AmiCopyEbsBlockDeviceArgs>>? = null, val encrypted: Output<Boolean>? = null, val ephemeralBlockDevices: Output<List<AmiCopyEphemeralBlockDeviceArgs>>? = null, val kmsKeyId: Output<String>? = null, val name: Output<String>? = null, val sourceAmiId: Output<String>? = null, val sourceAmiRegion: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<AmiCopyArgs>

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.AmiCopy("example", {
name: "example",
sourceAmiId: "ami-xxxxxxxx",
sourceAmiRegion: "us-west-1",
tags: {
Name: "HelloWorld",
},
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.AmiCopy("example",
name="example",
source_ami_id="ami-xxxxxxxx",
source_ami_region="us-west-1",
tags={
"Name": "HelloWorld",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.AmiCopy("example", new()
{
Name = "example",
SourceAmiId = "ami-xxxxxxxx",
SourceAmiRegion = "us-west-1",
Tags =
{
{ "Name", "HelloWorld" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewAmiCopy(ctx, "example", &ec2.AmiCopyArgs{
Name: pulumi.String("example"),
SourceAmiId: pulumi.String("ami-xxxxxxxx"),
SourceAmiRegion: pulumi.String("us-west-1"),
Tags: pulumi.StringMap{
"Name": pulumi.String("HelloWorld"),
},
})
if err != nil {
return err
}
return nil
})
}
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()
.name("example")
.sourceAmiId("ami-xxxxxxxx")
.sourceAmiRegion("us-west-1")
.tags(Map.of("Name", "HelloWorld"))
.build());
}
}
resources:
example:
type: aws:ec2:AmiCopy
properties:
name: example
sourceAmiId: ami-xxxxxxxx
sourceAmiRegion: us-west-1
tags:
Name: HelloWorld

Constructors

Link copied to clipboard
constructor(deprecationTime: Output<String>? = null, description: Output<String>? = null, destinationOutpostArn: Output<String>? = null, ebsBlockDevices: Output<List<AmiCopyEbsBlockDeviceArgs>>? = null, encrypted: Output<Boolean>? = null, ephemeralBlockDevices: Output<List<AmiCopyEphemeralBlockDeviceArgs>>? = null, kmsKeyId: Output<String>? = null, name: Output<String>? = null, sourceAmiId: Output<String>? = null, sourceAmiRegion: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val deprecationTime: Output<String>? = null

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>? = null

Longer, human-readable description for the AMI.

Link copied to clipboard
val destinationOutpostArn: Output<String>? = null

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 encrypted: Output<Boolean>? = null

Whether the destination snapshots of the copied image should be encrypted. Defaults to false

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 kmsKeyId: Output<String>? = null

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
val name: Output<String>? = null

Region-unique name for the AMI.

Link copied to clipboard
val sourceAmiId: Output<String>? = null

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>? = null

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 tags: Output<Map<String, String>>? = null

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.

Functions

Link copied to clipboard
open override fun toJava(): AmiCopyArgs