ec2_ami_copy
copies AMI between AWS regions, return new image id
Collection: community.aws
Full Name: community.aws.ec2_ami_copy
Synopsis
copies AMI between AWS regions, return new image id
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| debug_botocore_endpoint_logs | bool | false | ||
| description | str | |||
| encrypted | bool | false | ||
| endpoint_url | str | |||
| kms_key_id | str | |||
| name | str | default | ||
| profile | str | |||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| source_image_id | str | yes | ||
| source_region | str | yes | ||
| tag_equality | bool | false | ||
| tags | dict | |||
| validate_certs | bool | true | ||
| wait | bool | false | ||
| wait_timeout | int | 600 |
Example
yaml
- name: Basic AMI Copy
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
- name: AMI copy wait until available
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
wait: true
wait_timeout: 1200 # Default timeout is 600
register: image_id
- name: Named AMI copy
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
name: My-Awesome-AMI
description: latest patch
- name: Tagged AMI copy (will not copy the same AMI twice)
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
tags:
Name: My-Super-AMI
Patch: 1.2.3
tag_equality: true
- name: Encrypted AMI copy
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
encrypted: true
- name: Encrypted AMI copy with specified key
community.aws.ec2_ami_copy:
source_region: us-east-1
region: eu-west-1
source_image_id: ami-xxxxxxx
encrypted: true
kms_key_id: arn:aws:kms:us-east-1:XXXXXXXXXXXX:key/746de6ea-50a4-4bcb-8fbc-e3b29f2d367b