During Creation of EC2 server install the SSM agent and attach the IAM AmazonEC2RoleforSSM policy on all the server
1. Create IAM role let say rajrole and attach the policy AmazonEC2RoleforSSM
2. Now create EC2 in which attach role rajrole and install SSM agent
3. Now Create IAM user account let say rajguptaaws and attach the AmazonSSMFullAccess policy by using IAM console
4. Now logging to IAM user account(rajguptaaws)
6. Now run the command from user account on all EC2 sever of main account
select run shellscript
Now select all EC2 server from main account on which you want to run the command
Now give the command which you want to run on all server let say
touch testfile - create testfile in /tmp directory
ls - list all file in /tmp directory
yum update -y -- yum update
After all command run you will get result like below
1. Create IAM role let say rajrole and attach the policy AmazonEC2RoleforSSM
2. Now create EC2 in which attach role rajrole and install SSM agent
3. Now Create IAM user account let say rajguptaaws and attach the AmazonSSMFullAccess policy by using IAM console
4. Now logging to IAM user account(rajguptaaws)
6. Now run the command from user account on all EC2 sever of main account
select run shellscript
Now select all EC2 server from main account on which you want to run the command
Now give the command which you want to run on all server let say
touch testfile - create testfile in /tmp directory
ls - list all file in /tmp directory
yum update -y -- yum update
After all command run you will get result like below
No comments:
Post a Comment