Aws Lambda - Copy Ec2 Snapshot Automatically Between Regions?
I'd like to create a Lambda function (python) that will copy an already created snapshot to another region, automatically. I've reached out to AWS Support and they've only sent me
Solution 1:
Yes you can do that with boto3
Example:
Copying snapshot from region us-east-1
to region eu-west-1
import boto3
deflambda_handler(event, context):
client = boto3.client('ec2')
client.copy_snapshot(SourceSnapshotId='snap-xxxxxx',
SourceRegion='us-east-1',
DestinationRegion='eu-west-1')
If the snapshot is encrypted, add PresignedUrl
parameter additionally.
Post a Comment for "Aws Lambda - Copy Ec2 Snapshot Automatically Between Regions?"