I want to automatically configure an EC2 via a build, using the aws cli and ssm.
The (manual) setup for the container looks something like this:
- Create an EC2
- Run a shell script as root
- Run a shell script as a specific user
Is it possible to run a command on an ec2 utilising a tool such as
aws ssm send-command specifying the linux user which will execute the command?
Assuming the command is a shell script, would specifying the user inside the script do the same job? e.g using
sudo su my_user