How to write bash or shell script in SSM run command and execute in linux ec2 instance?



  • I want to run the bash or shell script in Linux using the SSM run command. But I don't want to write it on the Linux server and execute it remotely using the SSM command. I want to write a script in the run command itself.

    Is there any way to run a script from the AWS console? Apart from the run command is there any other way to run the whole script?

    I am referring to the multiline script not only one command.



  • First option using aws "CloudShell" service (available only in specific region).

    Alternately, you can execute shell script using AWS Systems Manager > Run Command > Run a command, Select the type of command that you want to run & Search by keyword " AWS-RunShellScript " (Linux platform only).

    In Command Parameters, specify a shell script or a command to run.

    PS : For both Windows & Linux platform, search by keyword " AWS-RunPowerShellScript "



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2