github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/ami_copy.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_ami_copy"
     4  sidebar_current: "docs-aws-resource-ami-copy"
     5  description: |-
     6    Duplicates an existing Amazon Machine Image (AMI)
     7  ---
     8  
     9  # aws\_ami\_copy
    10  
    11  The "AMI copy" resource allows duplication of an Amazon Machine Image (AMI),
    12  including cross-region copies.
    13  
    14  If the source AMI has associated EBS snapshots, those will also be duplicated
    15  along with the AMI.
    16  
    17  This is useful for taking a single AMI provisioned in one region and making
    18  it available in another for a multi-region deployment.
    19  
    20  Copying an AMI can take several minutes. The creation of this resource will
    21  block until the new AMI is available for use on new instances.
    22  
    23  ## Example Usage
    24  
    25  ```hcl
    26  resource "aws_ami_copy" "example" {
    27    name              = "terraform-example"
    28    description       = "A copy of ami-xxxxxxxx"
    29    source_ami_id     = "ami-xxxxxxxx"
    30    source_ami_region = "us-west-1"
    31  
    32    tags {
    33      Name = "HelloWorld"
    34    }
    35  }
    36  ```
    37  
    38  ## Argument Reference
    39  
    40  The following arguments are supported:
    41  
    42  * `name` - (Required) A region-unique name for the AMI.
    43  * `source_ami_id` - (Required) The id of the AMI to copy. This id must be valid in the region
    44    given by `source_ami_region`.
    45  * `source_ami_region` - (Required) The region from which the AMI will be copied. This may be the
    46    same as the AWS provider region in order to create a copy within the same region.
    47  * `encrypted` - (Optional) Specifies whether the destination snapshots of the copied image should be encrypted. Defaults to `false`
    48  * `kms_key_id` - (Optional) The 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
    49  
    50  This resource also exposes the full set of arguments from the [`aws_ami`](ami.html) resource.
    51  
    52  ## Attributes Reference
    53  
    54  The following attributes are exported:
    55  
    56  * `id` - The ID of the created AMI.
    57  
    58  This resource also exports a full set of attributes corresponding to the arguments of the
    59  [`aws_ami`](ami.html) resource, allowing the properties of the created AMI to be used elsewhere in the
    60  configuration.