How To: EC2 Automation Using AWS Systems Manager (3 Min) | Documents

preview_player
Показать описание
In this tutorial, you'll learn how to perform EC2 Automation Using AWS Systems Manager Documents.
_
Video Transcript:
_
Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn how to perform EC2 automation using AWS systems manager. Let's start by navigating to the EC2 dashboard then click on launch instance and give your instance a name.

I'm going to select 3 for a number of instances then choose an AMI an instance type and a key pair. Let's leave the network settings to default then hit launch instance. Click on view all instances and you should see all three instances in the pending state.

Let's navigate to the tags Tab and change the name of our servers. I'm going to name the first server my Dev server 1-second one my Dev server 2 and the third one my Dev server 3. Next, let's navigate to the systems management service then click on fleet manager in the left menu.

The reason we don't see anything here is that we still haven't been given SSM permissions to view our EC2 instances. Let's fix that by going to the IAM service and then clicking on roles. Click on create role then choose EC2 under common use cases.

Hit next then search for SSM and select Amazon EC2 role for SSM. then hit next. Give your role a name then hit create the role. Let's head back to the EC2 dashboard and select our first Dev server.

Click on the Actions drop-down and choose to modify the IAM role from the Securities drop-down. Select the IAM role that we just created then hit update. Repeat these steps for my Dev server too and my Dev server 3.

Let's navigate back to the systems manager window and give it a few minutes for our EC2 to show up as managed nodes. Now we can head back to the systems manager service page and click on documents in the left menu. Search for EC2 and let's pick AWS to stop the EC2 instance document.

If you look at the content tab, you can find the actions. This document will perform on our managed instances. Click on execute automation then scroll down to the point input parameters section.

I'm going to select all three of my Dev servers. Leave everything else to default then hit execute. Let's head back to the EC2 dashboard to check the status of our instances as expected the dev servers are now in a stopping State.

Give it a few minutes and you should see your instant State change to stopped. Now say you wanted to start all your instances through the systems manager, you could go back to documents and execute the AWS start EC3 instances document. Just make sure to select the show all instance drop-down in the input parameters section.

Select all your Dev servers then hit execute. There you have it. If you have any questions, leave them in the comment section below.

Don't forget to like, subscribe, and turn on your notification bell. Until next time.
Рекомендации по теме
Комментарии
Автор

Thanks for this Video.. But how to use the AWS Systems Manager automation document for AWSSupport-CopyEC2Instance. Plz guide me...

talkdevnair