By using AWS re:Post, you agree to the Terms of Use

Installing Agent on Elasticbean Stalk on creation of new application


Hi, I would like to install the SSM Agent on my ec2 server when I create a new elastic beanstalk environment, I've researched and saw that you need to create an .ebextension and config file.What commands I should have in the config file specifically for SSM Agent? I have found for the ec2 instance ( ) however it seems that EBS needs to be configured after the application is created and not before creation. Any help?

1 Answers
Accepted Answer


The SSM agent comes installed on all Amazon Linux 2 AMI's now so it should be on Beanstalk AMI's as they are based on normal AL2 AMI's.

By default, SSM Agent is installed on Amazon Linux Base Amazon Machine Images (AMIs) dated 2017.09 and later.  [1]

You can connect to your instance via SSH and confirm its running, checkout these commands. [2]

If you are modifying the agent / EC2 Instance in anyway it should be done via ebextensions only and not on the instance via SSH. [3]

profile picture
answered a month ago
  • Hello Cormac, Thanks so much for your reply! I have a question with regards to using the .ebextensions to modify the agent, I'm not sure what exactly i need to write on the conf files to edit or modify the SSM agent, do you have a snippet or example you could show me ?

  • @AWS-User-6424256 - this depends on what you want to configure, you will need to provide more info on your use case. Are you using the agent so you can access the instance via Session Manager? If so then all you should need to do is add permissions to the default Beanstalk instance profile "aws-elasticbeanstalk-ec2-role"

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions