Reference no: EM133370714
1 In your AWS Management Console, create a Microsoft Windows Server 2019 Base VM using the t2.micro type. On the Configure Security Group page, add a security group rule that allows All ICMP - IPv4 traffic from Anywhere. You can associate a key pair with the VM or not-you will not need to remote into it.
2 Go to the Simple Notification Service, which is grouped in the Application Integration category. In the navigation pane on the left, click Topics. Click Create topic. Give the topic a name, such as AdminAttn. The topic name could describe the resource the topic will be attached to, such as EC2, the application it's connected to, or the people or services that will be subscribed to it. You can also give it a display name if you want to, such as your name, the name of your cloud network or resource, or the name of your organization. Click Create topic.
3 On the topic's page, scroll down and click Create subscription. For Protocol, choose Email. In the Endpoint field, enter your email address. You will need access to this email account to confirm the subscription. Click Create subscription. When you receive the confirmation email, open it and click Confirm subscription.
4 Return to your list of topics page, click the topic to select it and click Publish message. Give the message a subject, such as a Test message. Enter text for the message body. Click Publish message. Check your email to confirm the message came through. Did it work? If not, troubleshoot the problem.
5 Go to the CloudWatch service, which is grouped in the Management & Governance category. In the navigation pane, click Metrics. Because you created the VM at the beginning of this project, EC2 should be listed at the bottom of this screen. If it's not, check your EC2 service to confirm your instance is fully initialized. On the Metrics screen in the CloudWatch service, click the EC2 tile. Click Per-Instance Metrics. Click the check box to select the NetworkIn metric. Click the Graphed metrics tab, and then click the Create alarm icon under Actions, as shown in Figure 9-18.
6 Change the Period field to 1 minute. In the Conditions section, select Greater/Equal and define the threshold at 1500. Click Additional configuration and notice that the datapoints to alarm option is set at 1 out of 1. Click Next.
7 Click in the Send a notification to...field and select the topic you configured in Step 2. In addition to a notification, what other actions are available for this alarm? Click Next.
8 Give the alarm a name, such as EC2NetworkIn, and click Next. Click Create alarm.
9 In the navigation pane, click Alarms. What state is the alarm in?
10 Every 30 seconds or so, refresh the list of alarms until the alarm state changes. What state is the alarm in now?
11 Click to select your alarm, and then click View in metrics. At the top of the screen, click 1h.
12 In your browser, open a second tab and go to the EC2 service. Copy the VM's public IP address.
13 On your local computer, open a Command Prompt window. Enter the following command, using the VM's public IP address:
ping <ip-address> -t -l 1500
The -t switch runs the ping indefinitely until you tell it to stop. The -l switch increases the size of the ping packets. Note that the ping might not complete successfully; however, all you need to do is generate the incoming traffic so you can collect metrics on it.
14 While your ping command is running in your Command Prompt window, repeatedly refresh the graphed metric in CloudWatch until the metric shows increased traffic and the alarm is triggered. What happens next? Note that it might take a minute or two for the alarm's action to take place.
15 Return to the EC2 service, and check the Monitoring tab for your VM. If needed, click the Refresh icon. What other metrics show increased utilization?
16 Stop the ping and wait a few minutes until the traffic level returns to normal. What happens to the alarm?
17 Delete all of the resources you created in this project, including the VM, topic, and alarm. Check through your account to confirm that all related resources have been deleted.