Skip to content

panwar100/Configuring-Amazon-EC2-using-AWS-SystemsManager-SSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Configuring-Amazon-EC2-using-AWS-SystemsManager-SSM

Configuring an Amazon EC2 instance using AWS Systems Manager (SSM) involves several steps. This service allows you to manage your EC2 instances at scale without needing to connect to them directly. Below are the steps to configure an EC2 instance through AWS Systems Manager 0

Prerequisites:

  • You should have an AWS account.
  • You should have one or more EC2 instances launched and running.(use vpc default and In firewall(security group)-allow ssh,http,https traffic from the internet) 1

1.Create an IAM Role for Systems Manager:

  • Go to the AWS Management Console.
  • Navigate to the Identity and Access Management (IAM) dashboard.
  • Create a new IAM role and attach the "AmazonEC2RoleforSSM" policy to it. This policy grants necessary permissions to Systems Manager for EC2 instances. 2 2 1 3 4
  • Attach this IAM role to your EC2 instance when launching or modify the instance's IAM role. 5 6

2.Install the SSM Agent on the EC2 Instance:

3.Verify SSM Agent Status:

  • After installation, ensure that the SSM Agent is running and configured correctly by running the following command on your EC2 instance:
  • sudo systemctl status amazon-ssm-agent 8 The status should indicate that it is active and running.

4.Create an SSM Run Command:

Now that your EC2 instances are configured with SSM, you can use Systems Manager to perform various tasks, such as running commands or automating tasks:

  • In the AWS Systems Manager console, go to "Run Command" and create a new command. 9
  • Select the EC2 instances you want to target. 10 12 13
  • Choose the SSM document created in the previous step.
  • Configure any parameters or inputs required by the document. 11
  • Start the command execution.

5.Monitor and View Results:

  • You can monitor the progress and view the results of the SSM Run Command execution in the AWS Systems Manager console. This allows you to ensure that the desired configuration or automation task was executed successfully. 14
  • If you want to make some changes to the code, click Copy to new. 15
  • change the command.
  • 16 17 18

AWS Systems Manager also provides capabilities for patch management, inventory management, and more. Explore the documentation and features to make the most of SSM for managing your EC2 instances efficiently and securely.

  • [NOTICE:]If you connect ec2 ssh you can see that ssm agent is open. 19 20

About

Configuring an Amazon EC2 instance using AWS Systems Manager (SSM)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published