© 2026 Amazon Web Services, Inc. or its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without prior written permission from Amazon Web Services, Inc. Commercial copying, lending, or selling is prohibited. All trademarks are the property of their owners.
Note: Do not include any personal, identifying, or confidential information into the lab environment. Information entered may be visible to others.
Corrections, feedback, or other questions? Contact us at AWS Training and Certification.
Tasks to be solved for this lab are divided into three parts. The first part requires you to create a custom mechanism that sends out an email notification when an AWS Systems Manager SSM document successfully completes. The second part requires you to use AWS CloudFormation drift detection to discover configuration changes and perform remediation actions using SSM documents. The third part requires you to use AWS Config rules to detect an Amazon Simple Storage Service (Amazon S3) storage configuration that is out of compliance with company policy and then setup an auto-remediation solution for all occurrences of the issue using AWS Config rules and SSM documents.
This lab concludes the Cloud Operations on AWS course. It is intended to provide both a summary review of monitoring tools previously covered, as well as a review of the final day’s topics including networking and storage. In this lab students are guided through three distinct monitoring and troubleshooting scenarios which are solved by using some of the tools and techniques previously covered.
By the end of this lab, you should be able to do the following:
This lab requires the following prerequisites:
Various icons are used throughout this lab to call attention to different types of instructions and notes. The following list explains the purpose for each icon:
To launch the lab, at the top of the page, choose Start Lab.
Caution: You must wait for the provisioned AWS services to be ready before you can continue.
To open the lab, choose Open Console .
You are automatically signed in to the AWS Management Console in a new web browser tab.
Warning: Do not change the Region unless instructed.

If you see the message, You must first log out before logging into a different AWS account:
In some cases, certain pop-up or script blocker web browser extensions might prevent the Start Lab button from working as intended. If you experience an issue starting the lab:
The following diagram represents the major components used in this lab. The numbers represent the logical workflow of the architecture in this lab.

Image description: The preceding diagram depicts the group labeled as part 1 displays the relevant Amazon Web Services (AWS) services you use to build a notification mechanism. This notification mechanism is leveraged by the groups in the lab labeled part 2 and part 3.The group labeled as part 2 displays the relevant AWS services you use to make changes to the existing lab environment and complete part 2 of the lab. In part 2 of the lab, the drift detection tool of CloudFormation is used to locate a configuration change of the stack. The change is remediated with SSM documents. The completion of these SSM documents sends a notification out from the mechanism that was created in part 1 of the lab.The group labeled part 3 displays the relevant AWS services you use to make changes in the existing lab environment and complete part 3 of the lab. In part 3 of the lab, AWS Config Rules and AWS Systems Manager SSM documents are used together to create an auto-remediation mechanism for certain configuration AWS resources in the lab environment. When this auto-remediation mechanism completes running, a notification is sent out from mechanism created in part 1.
In this task, you use the Amazon SNS and Amazon EventBridge services to create email notifications following the successful completion of an SSM document.
Instructions in this challenge section are purposefully left vague to give you a chance to apply techniques learned from previous labs and resolve the compliance issue. You can skip this challenge section and continue on to the detailed guidance steps if you choose.
For the challenge section, try to build a mechanism using Amazon EventBridge that forwards notifications to an Amazon SNS topic whenever an SSM document from the Systems Manager service successfully completes.
Continue on to the next task for detailed guidance.
In this task, you create the Amazon SNS topic necessary for setting up a notification service, and then subscribe your mail address to the topic.
At the top of the AWS Management Console, in the search bar, search for and choose
Locate the Amazon SNS navigation menu on the left of the console. If necessary, expand the service navigation menu by choosing the menu.
In the left navigation pane, choose Topics.
Choose Create topic.
For Type, select Standard.
For Name enter
Choose Create topic.
The Amazon SNS topic SuccessfulAutomationAction is created and details page for the topic is displayed.
Task complete: You have created a new Amazon SNS topic.
Subscribe to an existing Amazon Simple Notification Service topic. The topic is used to alert all subscribers about the successful completion of Systems Manager SSM document executions.
Still on the same page, in the Subscriptions tab, choose Create subscription.
For Protocol, select Email.
For Endpoint, enter a valid email address you can access.
Note: In your personal AWS environment, this might be an email alias for all of the CloudOps engineers. Individuals receive an email and have to confirm their subscription prior to receiving future notifications from the topic.
Choose Create subscription.
A banner message similar to the following is displayed at the top of the page, “ Subscription to SuccessfulAutomationAction created successfully.” letting you know the email address was successfully registered to the Amazon SNS topic.
Open the inbox of the email address you entered for the subscription.
Locate a recent message from
Note: It may take up to 5 minutes to receive the email, depending on your email server.
Choose the Confirm subscription link contained in the email.
A page is opened confirming the subscription. 
Close the Amazon SNS topic subscription confirmation page.
Task complete: You have successfully subscribed to an Amazon SNS topic. With a subscription, Amazon SNS pushes new messages from this topic to your email address.
In this task, you setup a new Amazon EventBridge rule to monitor for SSM document successful completion and then publish notifications through an Amazon SNS topic.
At the top of the AWS Management Console, in the search bar, search for and choose
In the left navigation pane, under Buses, choose Rules.
Ensure that the Event pattern rules tab is selected, then choose Create rule.
Note: If you see a Rule creation experience dialog, de-select the Visual rule builder opt in option.
In the Rule detail section, for Name enter
Choose Next.
For Event source, select AWS events or EventBridge partner events.
In the Event pattern section:
Under Event Type Specification 1, select Specific detail type(s).
In the Specific detail type(s) menu, select only EC2 Automation Execution Status-change Notification.
Under Event Type Specification 2, select Specific status(es).
In the Specific status(es) menu, select only Success.
Choose Next.
The Select target(s) page is displayed.
Under Target types, ensure AWS service is selected.
For Select a target search for and choose
In the Topic drop-down menu, select SuccessfulAutomationAction.
Under Permissions, clear the checkbox next to Use execution role (recommended).
Choose Next.
On the Configure tags - optional page, choose Next.
On the Review and create page, choose Create rule.
The event pattern rule is created. It appears in the list of rules. The newly created rule will be enabled by default.
Task complete: You have created a new EventBridge rule and linked it to the Amazon SNS topic.
At the top of the AWS Management Console, in the search bar, search for and choose
In the left navigation pane, under Change Management Tools, choose Documents.
On the Documents page, verify that Owned by Amazon is selected, then in the search area, search for
Choose the link for AWS-ConfigureCloudWatchOnEC2Instance.
The Description page for the command document is displayed.
Choose the Content tab and review the SSM document.
Choose Execute automation.
The Execute automation runbook page is displayed.
Leave the default choice of Simple execution.
Note: Simple execution is a good choice for this lab as the architecture is relatively straightforward. Read descriptions of the other execution options and think about what kinds of scenarios they would be useful for.
From the left of these lab instructions, copy the value for the InstanceID.
Back in the Systems Manager console, locate the Input parameters section and under InstanceId paste in the value you just copied.
Scroll down and choose Execute.
Warning: If the SSM document execution status fails instead of succeeding, double-check the values used in the Input parameters section. Whitespace used in the InstanceID field could cause an error. If you find any errors, correct them, wait one minute and run the SSM document once more. Ask your instructor if you need help retrying this SSM document.
Within a minute, the Overall status in the Execution status section returns ‘ Success’.
Return to the inbox of the email account you subscribed to the Amazon SNS topic named SuccessfulAutomationAction and wait for an email from Amazon SNS.
Amazon SNS delivers to your email a JSON formatted text string detailing the SSM document that completed.
Note: It may take up to 5 minutes to receive the email depending on your email server.
Task complete: You have run an SSM document, triggered the notification system and completed this task.
In this task, you use AWS CloudFormation drift detection to detect a change to your networking security and then setup auto remediation for this specific issue using AWS Systems Manager.
Note: Recall from lab 2 ‘Infrastructure as Code’ that drift detection is a tool in AWS CloudFormation that helps you identify what item(s) in your AWS CloudFormation stack(s) are currently out of synchronization from their original template. Automated drift detection for stacks is not a feature built-in to AWS CloudFormation.
Learn more: Refer to additional resources to discover using multiple AWS services to build an architecture that automatically detects drift.
Instructions in this challenge section are purposefully left vague to give you a chance to apply techniques learned from previous labs and resolve the compliance issue. You can skip this challenge section and continue on to the detailed guidance steps if you choose.
For the challenge section, find the change made to your environment by comparing the original AWS CloudFormation template and the current configuration of resources. Once you find the changes made to your environment, revert the resource back to their original configuration using a Systems Manager SSM document. Then run drift detection once again to confirm resources are in synchronization with their original AWS CloudFormation template.
Continue on to the next task for detailed guidance.
In this task, perform a drift detection operation.
Drift detection is a tool within the AWS CloudFormation service that lets you quickly locate stack resources which are no longer configured as defined by their original template.
Learn more: Refer to additional resources for documentation on a current list of resources supported by drift detection as well as some notable limitations of the tool.
At the top of the AWS Management Console, in the search bar, search for and choose
Choose the Stack name link for the AWS CloudFormation stack with the Description of Lab 6 Capstone.
The Stack info page is displayed.
Choose the drop-down and select Detect drift.
An informational banner is displayed at the top of the page with text similar to, ‘Drift detection initiated for arn:aws:cloudformation:us-west-2:1234567890:stack/qls-abcdefg123’.
Wait as long as 1 minute for the drift detection job to complete before continuing to the next task.
Task complete: You have started a drift detection operation.
From the menu, select View drift results.
The Drifts page is displayed.
The Drift status for this stack is DRIFTED.
Locate the Resource drift status section.
Review which resource has a Drift status MODIFIED.
Select AppSecurityGroup.
Choose .
The Drift details page is displayed.
In the Resource drift overview section, copy the value for the Physical ID of the Security Group to a notepad. The ID begins like sg-1234…. You will need this value in a later task.
In the Differences section, select SecurityGroupIngress.
Review the highlighted code in the Details section and discover what configuration has been changed in this Security group.
Task complete: You have used drift detection to identify specific stack resources that have changed from the stack template.
In this task, you use SSM documents to disable public access to individual Amazon EC2 Security groups.
At the top of the AWS Management Console, in the search bar, search for and choose
In the left navigation pane, under Change Management Tools, choose Documents.
On the Documents page, verify that Owned by Amazon is selected, then in the search area, search for
Choose the link for AWS-DisablePublicAccessForSecurityGroup.
The Description page for the command document is displayed.
Choose the Content tab and review the SSM document.
Choose Execute automation.
The Execute automation runbook page is displayed.
Leave the default choice of Simple execution.
In the Input Parameters section, locate the GroupId and paste in the Security Group ID you copied earlier.
Note: It is a string value that starts with sg-. The same value is also located to the left of these lab instructions.
Scroll down and choose Execute.
The Execution details page is displayed.
A banner message is displayed at the top of the page with text similar to Execution has been initiated.
Wait until the Overall status in the Execution status section of the page displays Success.
Note: You may notice some of the individual executed steps from the operation succeed while others fail. Recall the content of the document you examined before you ran it. There are more cases handled by the document than are applicable to the current scenario. If you investigate the reason for the individual step failure, the reason is because the rule specified by that step does not exist in the security group you specified. Overall the document succeeds with individual failed steps. This is by design.
Return to the inbox of the email account you subscribed to the Amazon SNS topic named SuccessfulAutomationAction and wait for an email from Amazon SNS.
Amazon SNS delivers to your email a JSON string detailing each of the SSM document steps that complete.
Note: It may take up to 5 minutes to receive the email depending on your email server. You do not need to wait for the email notification as you have already tested that the system works in task 2.2.
Task complete: You manually ran an SSM Document and removed a publicly available SSH port from a security group.
Run the CloudFormation drift detection operation to verify stack resources are in sync with the template that created them.
At the top of the AWS Management Console, in the search bar, search for and choose
Choose the Stack name link for the AWS CloudFormation stack with the Description of Lab 6 Capstone.
The Stack info page is displayed.
Choose the drop-down and select Detect drift.
An informational banner is displayed at the top of the page with text similar to ‘Drift detection initiated for arn:aws:cloudformation:us-west-2:1234567890:stack/qls-abcdefg123’
Wait as long as 1 minute for the drift detection job to complete before continuing to the next task.
From the menu, select View drift results.
The Drifts page is displayed.
Confirm that the Drift status now displays IN_SYNC.
Task complete: After making a configuration change to a security group using an SSM document, you then ran the AWS CloudFormation drift detection tool and verified that the stack is now in sync with the original template.
In this task, you use AWS Config to detect non-compliance violations with your company’s data security policy regarding Amazon S3 Buckets that do not have bucket versioning enabled. Next, you institute an automated remediation action to correct this particular violation, as well as future potential violations of this policy.
Use the AWS Config service to identify non-compliant storage resource that currently exist in the infrastructure.
At the top of the AWS Management Console, in the search bar, search for and choose
Choose Get started.
The Settings page of the AWS Config setup is displayed.
In the Recording method section, under Recording Strategy section, select All resource types with customizable overrides.
In the Default settings section, under Recording Frequency, select Continuous recording.
In the Data governance section, under IAM role for AWS Config section, select Choose a role from your account.
From the Existing roles dropdown, choose AWSServiceRoleForConfig.
In the Delivery channel section, under Amazon S3 bucket section, select Create a bucket.
Choose Next.
The Rules page of the AWS Config setup is displayed.
Search for the AWS Managed Rule named
Select S3-bucket-versioning-enabled.
Choose Next.
The Review page of the AWS Config setup is displayed.
Choose Confirm.
AWS Config finishes its initial setup process.
The AWS Config dashboard is displayed.
In the left navigation pane, choose Rules.
Choose the link for s3-bucket-versioning-enabled.
In the Resources in Scope section, select All from the dropdown menu.
Important: If your AWS Config rule returns a result of No resources in scope you need to wait as long as 5 minutes for other AWS resources to synchronize with AWS Config and re-evaluate the AWS Config rule.
In the Resources in scope section, the Compliance column displays a status of Evaluating… for the rule while the scan is in progress. A result of Noncompliant appears after a few minutes when the compliance scan is finished.
For this step of the lab you do not need to wait for the status to change from Evaluating… to Noncompliant. Continue to the next step.
In the Resources in scope list, locate the bucket with the string labbucket in the name and choose the link for it. You may need to expand the column width to view the full bucket names.
The resource Details page is displayed.
Choose Manage Resource .
The details page for the Amazon S3 bucket is displayed.
Select the Properties tab.
Verify that Bucket Versioning is Disabled for this bucket.
Instructions in this challenge section are purposefully left vague to give you a chance to apply techniques learned from previous labs and resolve the compliance issue. You can skip this challenge section and continue on to the detailed guidance steps if you choose.
For the challenge section, identify the appropriate SSM document to use. Then find a way to link the deployment status of the SSM document to the AWS Config rule findings of non-compliant resources.
Continue on to the next task for detailed guidance.
In this task, you set up the auto-remediation for the AWS Config rule and verify the results.
At the top of the AWS Management Console, in the search bar, search for and choose
In the left navigation pane, choose Rules.
Choose the link for s3-bucket-versioning-enabled.
The Details page for the rule is displayed.
Choose Actions .
Choose Manage remediation.
The Edit: Remediation action page is displayed.
In the Select remediation method section, select Automatic remediation.
In the Remediation action details section, from the Choose remediation action dropdown menu, search for and select
In the Resource ID parameter section, select BucketName from the drop-down menu.
In the Parameters section, configure the following:
Choose Save changes.
The Details page for the rule is displayed.
With auto-remediation now set up for the AWS Config rule, the resources found to be noncompliant by the Config rule are fixed without user intervention.
Scroll down the page to the Resources in scope section. select All All from the dropdown menu.
If you wait long enough, you will see that the compliance status of the S3 bucket that contains labbucket in the bucket name changes to Compliant.
However, you do not need to wait from the status to change to compliant. Continue onto the next step.
Note: From this point on, if more S3 buckets without Bucket Versioning are added to the environment, they would also be detected by the Rule scan and auto-remediated without the need of manual action.
(Three Optional steps) Rather than waiting for auto-remediation actions, the following three steps detail manual remediation.
From the Rules page of the AWS Config console, choose the link for s3-bucket-versioning-enabled.
Select the S3 bucket with the string labbucket in the name.
Choose Remediate.
The Action Status column for the resource changes from ‘n/a’ to 'Action execution queued… ’ and finally to ‘ Action executed successfully’ when the SSM document specified in the Remediation settings of the rule completes.
Note: It takes a few minutes for the resource to be re-classified as compliant by AWS Config. It is not necessary to wait for this. Continue onto the next task.
In part 1 of the lab you created a notification mechanism. The email account you subscribed to the Amazon SNS topic named SuccessfulAutomationAction receives a new email from Amazon SNS as each time an SSM document completes. The email is a JSON string detailing each of the steps that SSM document completes. In this task each time a resource is auto-remediated by Config, a new email is be sent out. This is because the auto-remediation is occurring through use of SSM documents.
Note: It may take up to 5 minutes to receive the email, depending on your email server. You do not need to wait for email notifications about all the non-compliant Amazon S3 buckets to continue with the lab.
Locate the Resources in scope section.
Select All from the drop-down menu in the Resources in Scope section.
Choose the link for the bucket with the string labbucket in the name.
The details page of the resource is displayed.
Choose Manage Resource .
The S3 console is displayed with the details of the selected bucket.
Choose the Properties tab.
Verify the Bucket Versioning is Enabled for this Amazon S3 bucket.
Task complete: You have combined Systems Manager Command Documents, with AWS Config rule, and auto-remediation features. Non-compliant resources were located and remediated.
You have successfully done the following:
Follow these steps to close the console and end your lab.
Return to the AWS Management Console.
At the upper-right corner of the page, choose AWSLabsUser, and then choose Sign out.
Choose End Lab and then confirm that you want to end your lab.
For more information about AWS Training and Certification, see https://aws.amazon.com/training/.
Your feedback is welcome and appreciated.
If you would like to share any feedback, suggestions, or corrections, please provide the details in our AWS Training and Certification Contact Form.