PARALLAX

ec2_snapshot_copy

Copies an EC2 snapshot and returns the new Snapshot ID

Collection: community.aws

Full Name: community.aws.ec2_snapshot_copy

Synopsis

Copies an EC2 snapshot and returns the new Snapshot ID

Parameters

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

Example

yaml
- name: Basic Snapshot Copy
  community.aws.ec2_snapshot_copy:
    source_region: eu-central-1
    region: eu-west-1
    source_snapshot_id: snap-xxxxxxx

- name: Copy Snapshot and wait until available
  community.aws.ec2_snapshot_copy:
    source_region: eu-central-1
    region: eu-west-1
    source_snapshot_id: snap-xxxxxxx
    wait: true
    wait_timeout: 1200 # Default timeout is 600
  register: snapshot_id

- name: Tagged Snapshot copy
  community.aws.ec2_snapshot_copy:
    source_region: eu-central-1
    region: eu-west-1
    source_snapshot_id: snap-xxxxxxx
    tags:
        Name: Snapshot-Name

- name: Encrypted Snapshot copy
  community.aws.ec2_snapshot_copy:
    source_region: eu-central-1
    region: eu-west-1
    source_snapshot_id: snap-xxxxxxx
    encrypted: true

- name: Encrypted Snapshot copy with specified key
  community.aws.ec2_snapshot_copy:
    source_region: eu-central-1
    region: eu-west-1
    source_snapshot_id: snap-xxxxxxx
    encrypted: true
    kms_key_id: arn:aws:kms:eu-central-1:XXXXXXXXXXXX:key/746de6ea-50a4-4bcb-8fbc-e3b29f2d367b
Search
    ↑ ↓ move↵ openesc close