2

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.

2 Answers 2

0

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 "

-1

You can write a bash or shell script in SSM run command and execute it in a linux ec2 instance using the following command:

aws ssm run-command --document-name "MyShellScript" --instance-ids "i-1234567890" --parameters "MyScriptParameter=Value"

This will execute the "MyShellScript" script on the instance with ID "i-1234567890" and pass in the parameter "MyScriptParameter" with value "Value".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.