如何配置AWS自动化模板并设置每日快照跨区域复制调度?
Hey there! Let's break down exactly how to set up your daily EC2 snapshot creation and cross-region copy using AWS Ops Automator—no confusing jargon, just step-by-step actions.
1. Configure the
Amazon EC2 Create Snapshot Template First, head to your Ops Automator console and navigate to the Templates section. Find and select the Amazon EC2 Create Snapshot Template to start configuring:
- Give your template a clear name (like
Daily-us-east-2-EC2-Snapshots) and a brief description so you remember its purpose later. - Resource Selection: Choose the EC2 instances you want to snapshot. The easiest way is to use tags—if you tag your target instances with something like
Snapshot: Daily, you can set the template to filter by that tag. Make sure you selectus-east-2as the region here. - Snapshot Settings: Add a descriptive format for your snapshots (e.g.,
Daily snapshot for {{InstanceId}} | {{Date}}) so you can easily identify them later. If you don't want old snapshots piling up, enable the option to delete snapshots older than a set number of days (like 7 days) to keep costs in check. - Save the template and make sure it's marked as Enabled.
2. Set Up the
Amazon EC2 Copy Snapshot Template Next, configure the template to copy those snapshots to us-east-1:
- Back in the Templates section, select the
Amazon EC2 Copy Snapshot Template. - Name it something like
Copy-Snapshots-to-us-east-1and add a description (e.g., "Copies daily us-east-2 snapshots to us-east-1"). - Source Configuration: Set the source region to
us-east-2. To target only the snapshots you just created, use a tag filter—make sure you added a consistent tag (likeSnapshotType: Daily) in the creation template, then match that tag here. - Target Configuration: Choose
us-east-1as the target region. You can copy over the source snapshot's tags or add new ones (likeCopiedFrom: us-east-2) to track where the snapshot came from. - Double-check that the Ops Automator IAM role has permissions to copy snapshots across regions (the default setup usually includes this, but it's worth verifying if you've customized roles).
- Save and enable this template too.
3. Create a Daily Schedule to Run Both Tasks
Now you need to tie these templates to a daily schedule so they run automatically:
- Go to the Schedules section in Ops Automator and click Create Schedule.
- Name your schedule (e.g.,
Daily-Snapshot-Workflow) and add a description. - Trigger Rule: Select
Recurring schedule, set the frequency to Daily, and pick a time that works best (like 2 AM UTC, when traffic is low). - Associate Templates: Add both the snapshot creation template and the copy template to this schedule. Important: Set a dependency so the copy task runs after the creation task finishes—this ensures the snapshot exists before trying to copy it.
- Save the schedule and confirm it's enabled.
Quick Tips to Avoid Headaches
- Test First: Manually trigger the schedule once to make sure snapshots are created in
us-east-2and successfully copied tous-east-1. - Permissions Check: If something fails, verify the Ops Automator role has these permissions:
ec2:CreateSnapshot,ec2:CopySnapshot,ec2:DescribeInstances,ec2:DescribeSnapshots, and tag-related actions (ec2:CreateTags,ec2:DescribeTags). - Cost Management: Don't forget the auto-delete setting in the creation template—unused snapshots can add up fast!
内容的提问来源于stack exchange,提问作者RustyShackleford
相关产品推荐
相关产品推荐

