Automate EC2 Work Hours with Quick Setup
Schedule an EC2 instance around work hours with Systems Manager Quick Setup.
Introduction
30 Second Summary
An online server can keep adding to your bill after everyone has finished work. Remembering to stop it every evening turns cost control into a daily chore.
In this project, you will automate work hours for one Amazon EC2 instance with AWS Systems Manager Quick Setup Resource Scheduler. You will use tag-based targeting to keep the schedule focused on the intended instance.
What You'll Build
Picture opening the AWS Management Console to see the intended EC2 instance match the weekly work window you chose.
By the end of this project, you'll have:
- An exact target filter that returns only the instance tagged with AutoSchedule=weekday-hours.
- A weekly work-hours schedule using your chosen time zone, active days, start time, and stop time.
- A successful Quick Setup deployment that lets you confirm the instance is running or stopped as expected for the current schedule window.
- Secret Mission: Turn schedule membership into a reversible pause switch by removing and restoring the target tag.
Are there any prerequisites?
You need an AWS account with one existing EBS-backed EC2 instance that is safe to stop. Step 1 checks its Amazon EBS encryption status plus your IAM access before any schedule is created.
Before We Start
Before any hands-on work, lock in which Amazon EC2 instance you intend to schedule. Confirming why it can safely stop outside working hours keeps the automation focused on the right resource.
Check the Instance and Open Quick Setup
An automated schedule can stop the wrong workload when its target is vague. Before you schedule your Amazon EC2 instance, you need proof that the selected machine can safely stop in the correct AWS Region.
During this step, you'll use the AWS Management Console to identify the exact scheduling target. You'll confirm its Amazon EBS storage eligibility before checking AWS Systems Manager Quick Setup access.
In this step, get ready to:
- Identify the exact EC2 scheduling target.
- Confirm that its attached storage fits this project's safety scope.
- Verify access to Resource Scheduler in Quick Setup.
Confirm the target instance
A schedule needs one precise target before it can safely control anything. The instance ID identifies that target while its state and Region establish the starting point.
- Sign in to the AWS Management Console with the AWS account from earlier.
- Open Amazon EC2 from the console search.
- Choose Instances in the Amazon EC2 navigation pane.
- Select only the intended instance.
- Record the displayed instance ID: <target-instance-id>.
- Record its current state: current state shown in the console.
- Record the active AWS Region: <target-region>.
- Reconfirm that stopping this workload will not interrupt production.
That is the first safety gate cleared. Every later action can now point to one recorded instance.
What Can Change After a Stop?
Stopping an EBS-backed instance does not delete it. When the instance starts again, AWS typically assigns a new public IPv4 address.
Data on instance store volumes is erased during a stop. The storage check next confirms that this project's target uses Amazon EBS.
Inspect the attached storage
Storage details can feel fiddly because each attached volume opens on its own page. This check prevents the schedule from relying on storage permissions outside this project's scope.
- Choose the Storage tab on the selected instance details page.
- Find the Block devices section.
- Confirm that the root device is backed by Amazon EBS.
- Open the first Volume ID.
- Check its detailed information to confirm that encryption is disabled.
- Return to the Block devices section.
- Repeat the encryption check for every remaining Volume ID.
- Confirm that every attached volume is unencrypted.
You should be able to account for every attached volume. Each one should show that encryption is disabled.
Stop If the Storage Falls Outside Scope
- Stop this project if the root device uses instance store. That instance cannot be stopped and started by this workflow.
- Stop this project if any attached Amazon EBS volume is encrypted. Resource Scheduler then needs AWS KMS key permissions that this project does not configure.
- Choose another safe EBS-backed instance with unencrypted attached volumes before continuing.
Open Resource Scheduler in Quick Setup
Resource Scheduler is the Quick Setup feature that later connects a tag target to scheduled start and stop events. For this check, you only need to prove that the feature is available in the same Region as the instance.
Why Use Resource Scheduler?
Resource Scheduler is purpose-built for scheduled EC2 start and stop operations. A custom scheduling workflow would add API parameters and execution-role configuration.
Quick Setup may show console-led onboarding before its configuration library. The console creates the required IAM roles during that onboarding flow.
Before you open Quick Setup, which recorded Region should still appear in the console header?
- Set the AWS Management Console Region to <target-region>.
- Open AWS Systems Manager from the console search.
- Choose Quick Setup in Systems Manager.
- Complete the console-led onboarding if it appears.
- Locate the Resource Scheduler card.
- Confirm that Create is available on the card.
You should see the Resource Scheduler card with Create available while the console remains in <target-region>. This proves that your account can reach the scheduler setup for the target instance's Region.
Can't Access Quick Setup?
- Ask your AWS administrator to grant the actions in the official Quick Setup onboarding policy, including ssm-quicksetup:*.
- Return to Quick Setup after your access is updated.
Help me diagnose my Quick Setup access problem.
Checkpoint
Quick Setup is open in <target-region>. The Resource Scheduler card is visible and available.
Your existing instance <target-instance-id> is in <target-region>. You recorded its current state. You confirmed that it is safe to stop. Its root device is EBS-backed. Its attached EBS volumes are unencrypted.
Your target has cleared the instance, storage, Region, and access checks. Next, you'll give that one instance a precise schedule membership tag.
Mark One Instance for Scheduling
The previous step confirmed that the Amazon EC2 instance <target-instance-id> in the AWS Region <target-region> is safe to stop.
Its root volume uses Amazon EBS. Every attached EBS volume is unencrypted.
Cost-control automation needs a narrow target. This step uses tag-based targeting to mark one instance.
You will then test what the label can change on its own.
In this step, get ready to:
- Add the project tag to <target-instance-id>.
- Filter the instance list for the exact tag pair.
- Test whether the tag changes the EC2 instance state.
Select the intended instance
The saved instance ID is your guardrail against tagging the wrong workload.
- Return to the Amazon EC2 console tab from earlier.
- Confirm that the Region selector shows <target-region>.
- Choose Instances in the EC2 navigation pane.
- Select only <target-instance-id> from the instance list.
- Open the Tags tab for the selected instance.
The details view should show <target-instance-id>. This proves that you are changing the instance checked in the previous step.
Add the schedule tag
An EC2 tag pairs a user-defined key with a value. This project uses the exact pair AutoSchedule=weekday-hours.
- Choose Manage tags.
- Choose Add new tag.
- Enter AutoSchedule as the key.
- Enter weekday-hours as the value.
- Choose Save.
That's the targeting label in place. You should see AutoSchedule paired with weekday-hours on the Tags tab.
Why this tag pair?
The AutoSchedule=weekday-hours pair is a project-defined label. Its narrow value separates this work-hours target from unrelated instances.
EC2 tag keys are case-sensitive. Tag values are case-sensitive too.
Can't save the tag?
- Confirm that only <target-instance-id> is selected.
- Ask your AWS administrator to check whether your identity can tag that instance.
Help me troubleshoot this tag save problem.
Prove the tag targets one instance
A tag filter turns the label into visible proof of scope. The next check asks whether that label changed the instance itself.
- Return to Instances in the EC2 navigation pane.
- Add a tag filter for AutoSchedule.
- Set the filter value to weekday-hours.
You should see exactly one row. That row should show <target-instance-id>.
Does the filter show the wrong result?
- Check that the key uses the exact casing AutoSchedule if no instances appear.
- Check that the value uses the exact casing weekday-hours if no instances appear.
- Stop before continuing if several instances appear.
Help me fix the EC2 tag filter.
Before you refresh, do you think adding the tag changed the instance's state?
- Select <target-instance-id> from the filtered result.
- Refresh the instance details.
- Compare the current state with the state you recorded earlier.
You will see the same instance state you recorded earlier. This intended shortfall shows that the tag defines the target without automating it.
Your filter now isolates the intended instance. Next, you will connect that precise target to Resource Scheduler so its state follows your work hours.
Create the Work-Hours Schedule
The AutoSchedule=weekday-hours tag now isolates one safe Amazon EC2 instance. Its state still does not change automatically.
In this step, you'll use AWS Systems Manager Quick Setup Resource Scheduler to connect that tag to scheduled start and stop events. Your chosen time zone defines when the work window applies.
In this step, get ready to:
- Start a new Resource Scheduler configuration.
- Choose the tag target and work window.
- Create the schedule for the current account in the current Region.
Open the Resource Scheduler form
Resource Scheduler needs one configuration that joins the target tag to a schedule. The creation form collects both parts.
- Switch back to AWS Systems Manager Quick Setup in the AWS Region you confirmed earlier.
- Choose Create on the Resource Scheduler card.
You'll see sections for Instance tag, Schedule options, Targets, and Summary.
Why Resource Scheduler?
Resource Scheduler is purpose-built for scheduled EC2 start and stop operations. Its tag filter keeps the target narrow.
Define the tag and work window
The configuration must use the same tag key and value already attached to your instance. Its work window then defines the scheduled start and stop events.
- Enter AutoSchedule as the tag key under Instance tag.
- Enter weekday-hours as the tag value.
Why Exact Casing Matters
EC2 tag keys are case-sensitive. Tag values are case-sensitive too.
Both entries must match the instance tag exactly for the schedule to target it.
- Choose the time zone that matches your work location under Schedule options.
- Record your chosen time zone here: <selected-time-zone>.
The time zone selection should now show <selected-time-zone>.
- Select the days when the instance is needed.
- Record your selected active days here: <selected-active-days>.
The active-day selection should now show <selected-active-days>.
- Set the start time to the beginning of your work window.
- Record your selected start time here: <selected-start-time>.
The start-time selection should now show <selected-start-time>.
- Set the stop time to the end of your work window.
- Record your selected stop time here: <selected-stop-time>.
The stop-time selection should now show <selected-stop-time>.
Set the target and create the schedule
The target scope controls where Quick Setup looks for matching instances. This project keeps that scope inside your signed-in account and the Region confirmed earlier.
- Select Current account under Targets.
The account target should now show Current account.
- Select Current Region.
The regional target should now show Current Region.
- Review the Summary section.
The summary should show AutoSchedule with weekday-hours for Current account in Current Region.
The schedule should show <selected-time-zone> on <selected-active-days> from <selected-start-time> to <selected-stop-time>.
Creating this schedule can start or stop the tagged instance so its state matches the current work window. The instance is already confirmed safe to stop, so this change is expected.
- Choose Create at the end of the configuration form.
Quick Setup begins deploying the Resource Scheduler configuration to the selected account and Region.
- Predict whether the new configuration will appear with work in progress or at Success.
- Return to the Configuration managers table in Quick Setup.
- Confirm the new Resource Scheduler configuration is listed.
- Watch its deployment progress toward Success.
You'll see the new Resource Scheduler configuration listed. Its deployment is in progress or has reached Success.
You have connected the work-hours schedule to the exact tag on your instance. The instance may now start or stop to match the active schedule window.
Configuration Not Listed?
If no configuration appears, return to the creation form. Confirm that both tag entries and both target selections are present before retrying.
If deployment reaches Failed, use the failure information shown by Quick Setup to identify the blocked setting.
Help me troubleshoot this Resource Scheduler deployment.
Your work-hours schedule now targets exactly one tagged instance in the current account's Region. Next, you'll prove the automation reached the correct instance at the correct time.
Verify the Target and Scheduled State
Your work-hours configuration now connects the Resource Scheduler schedule to instances carrying AutoSchedule=weekday-hours in <target-region>.
A created configuration still needs deployment evidence. Exact targeting also needs proof.
You will collect that evidence in AWS Systems Manager Quick Setup. You will also compare the Amazon EC2 state with the current schedule window.
In this step, get ready to:
- Confirm that the configuration deployment reaches Success.
- Filter the EC2 instance list to prove that only the intended instance matches the schedule tag.
- Compare the instance state with the current schedule window.
Confirm the deployment succeeded
Quick Setup exposes a deployment status for each configuration. A Success status confirms that Quick Setup finished deploying your schedule configuration.
- Switch back to Quick Setup from earlier in <target-region>.
- Find your Resource Scheduler configuration in the Configuration managers table.
- Choose the configuration that targets AutoSchedule=weekday-hours.
- Inspect its configuration deployment status.
- Refresh the details until the status reads Success.
Expect to refresh for a few minutes while Quick Setup finishes the deployment. A short wait here is normal.
What Does Success Prove?
A Success status confirms that Quick Setup completed the configuration deployment. The next check proves that the schedule tag selects the correct instance.
Deployment Not Reaching Success?
- Confirm that Quick Setup is still showing <target-region>.
- Confirm that you opened the Resource Scheduler configuration targeting AutoSchedule=weekday-hours.
- Review the configuration deployment details if the status shows Failed.
Help me diagnose why my Quick Setup Resource Scheduler deployment is not reaching Success.
Confirm the exact target
Tag-based targeting determines which instances are eligible for scheduled events. A one-result filter proves that your schedule has a narrow scope.
- Switch back to Amazon EC2 from earlier in <target-region>.
- Choose Instances in the EC2 console.
- Add AutoSchedule as the tag key in the instance list filter.
- Set weekday-hours as the matching tag value.
- Read the instance ID in the filtered result.
You should see exactly one result. Its instance ID should be <target-instance-id>.
Seeing Zero or Multiple Instances?
A zero-result filter usually points to a tag casing or value mismatch. EC2 tag keys and values are case-sensitive.
More than one result means another instance carries the same project tag. Stop before judging the schedule so that you do not accept the wrong target.
Help me troubleshoot an EC2 tag filter that should return exactly one instance.
Compare the state with the schedule
Resource Scheduler uses event-driven automation. It acts at the configured schedule times.
The expected instance state comes from the current day in <selected-time-zone> and the work window you selected.
- Check the current day in <selected-time-zone>.
- Compare that day with <selected-active-days>.
- Check the current time in <selected-time-zone>.
- Compare that time with <selected-start-time> and <selected-stop-time>.
- Determine whether the current moment falls inside the active schedule window.
Before you refresh, predict whether the instance should be running or stopped for the current schedule window.
- Refresh the filtered EC2 instance list.
Inside the active window, you should see running. Outside the active window, you should see stopped.
The instance may have already matched the schedule before creation. Seeing it remain in the expected state after a successful deployment still proves the result.
Why Manual Changes Can Persist
Resource Scheduler acts at configured event times. A manual state change after an event is not immediately reversed.
The next configured event applies the corresponding start or stop action to matching instances.
Seeing the Unexpected State?
- Confirm that the Quick Setup deployment status still reads Success.
- Confirm that the tag filter returns only <target-instance-id>.
- Recheck the current day using <selected-time-zone>.
- Recheck the current time against <selected-start-time> and <selected-stop-time>.
Help me understand why my EC2 instance state does not match the Resource Scheduler window.
You've closed the loop. Your work-hours schedule now has visible proof from deployment through the EC2 state.
Secret mission
Build a Tag-Based Pause Switch
Pause one instance without deleting its shared Resource Scheduler configuration. Remove the target tag to exclude the instance from future schedule events. Restore the tag to return the instance to the same work-hours schedule.
Clean Up Your Resources
Clean Up Your Resources
Choose what happens to your work-hours schedule next. Your existing AWS resources can still incur charges despite Quick Setup having no charge.
Cost warning
Your existing Amazon EC2 instance can incur charges while it is running. Amazon EBS storage can continue incurring charges while the instance is stopped.
Networking or related service usage can also incur charges. Stopping the instance does not delete it.
Resources you used:
- One user-defined AutoSchedule=weekday-hours tag on <target-instance-id>.
- One Resource Scheduler configuration in <target-region> for the current AWS account.
- The configuration's deployed resources and related associations.
Keep everything running
No action needed. Choose this option if you still need future start and stop events.
- Leave the Resource Scheduler configuration in place.
- Leave the AutoSchedule=weekday-hours tag on <target-instance-id>.
The instance remains eligible for future events during your configured work-hours schedule.
Pause - I'll come back to this later
This option keeps the shared schedule configuration for later use. The target instance becomes ineligible for future schedule events.
- Switch back to the Amazon EC2 console from earlier.
- Confirm that the page is still showing <target-region>.
- Choose Instances.
- Select <target-instance-id>.
- Open the Tags tab.
- Choose Manage tags.
- Remove the AutoSchedule=weekday-hours row.
- Choose Save.
The instance state should remain unchanged immediately after this tag edit.
- Apply the EC2 tag filter for key AutoSchedule with value weekday-hours.
You should see zero matching instances. Future events from this schedule no longer include the target instance.
Delete - I don't want to use this again
Deleting the configuration looks substantial because it removes the schedule deployment. Your existing instance remains intact with its attached EBS volumes.
- Switch back to the Systems Manager Quick Setup page from earlier.
- Select this project's configuration in the Configuration managers table.
- Choose Actions.
- Choose Delete configuration.
- Follow the prompt to remove its targeted Regions.
- Wait for the deletion to complete.
- Refresh the Configuration managers table.
- Confirm that the configuration is no longer listed.
What does deletion remove?
Quick Setup removes the configuration's deployed resources and related associations. Future start and stop actions from this configuration stop.
Your existing EC2 instance remains in your account. Its attached EBS volumes also remain.
- Switch back to the Amazon EC2 console from earlier.
- Confirm that the page is still showing <target-region>.
- Choose Instances.
- Select <target-instance-id>.
- Open the Tags tab.
- Choose Manage tags.
- Remove the AutoSchedule=weekday-hours row.
- Choose Save.
- Apply the EC2 tag filter for key AutoSchedule with value weekday-hours.
You should see zero matching instances. The project-created automation is now gone. Your existing instance remains intact.
Nice Work!
Nice Work!
Excellent work! You built a work-hours controller for one Amazon EC2 instance with Resource Scheduler in AWS Systems Manager Quick Setup.
What you learned:
- Verified that Amazon EBS backed the target instance before scheduling it. You confirmed every attached volume was unencrypted.
- Scoped automation to one instance with tag-based targeting through AutoSchedule=weekday-hours. You connected that tag to a weekly work window in your chosen time zone.
- Completed deployment verification by confirming the Quick Setup status reached Success. You proved the tag filter returned only the intended instance. You matched its state to the current schedule window. You learned that scheduled events act at configured times.
- Secret Mission: Used the target tag as a reversible pause switch for future scheduled events. You restored the tag without immediately changing the instance state.
Ready to quiz yourself?