PARALLAX

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

NameTypeRequiredDefaultDescription
access_keystr
aws_ca_bundlepath
aws_configdict
debug_botocore_endpoint_logsboolfalse
descriptionstr
encryptedboolfalse
endpoint_urlstr
kms_key_idstr
namestrdefault
profilestr
regionstr
secret_keystr
session_tokenstr
source_image_idstryes
source_regionstryes
tag_equalityboolfalse
tagsdict
validate_certsbooltrue
waitboolfalse
wait_timeoutint600

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
Search
    ↑ ↓ move↵ openesc close