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
| 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 | |||
| profile | str | |||
| region | str | |||
| secret_key | str | |||
| session_token | str | |||
| source_region | str | yes | ||
| source_snapshot_id | str | yes | ||
| tags | dict | |||
| validate_certs | bool | true | ||
| wait | bool | false | ||
| wait_timeout | int | 600 |
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