aws-ssm
Securely interact with and manage AWS resources. tldr-pages
On several platforms
Several platforms
Securely interact with and manage AWS resources. Note: Interactive sessions require the Session Manager plugin to be installed.
Run commands on instances
aws ssm send-command --instance-ids instance_id1 instance_id2 ... --document-name "AWS-RunShellScript" --parameters 'commands=["command"]'Identify--instance-idsThe IDs of the managed nodes where the command should run. AWS CLI reference--document-nameThe name of the Amazon Web Services Systems Manager document (SSM document) to run. AWS CLI reference--parametersThe required and optional parameters specified in the document being run. AWS CLI referenceCheck command invocations on an instance
aws ssm list-command-invocations --instance-id "instance_id"Identify--instance-id(Optional) The command execution details for a specific managed node ID. AWS CLI referenceCheck command output for a specific command invocation
aws ssm list-command-invocations --command-id "command_id" --detailsIdentify--command-id(Optional) The invocations for a specific command ID. AWS CLI reference--details(Optional) If set this returns the response of the command executions and any command output. AWS CLI referenceStart an interactive session with an instance
aws ssm start-session --target "instance_id"Identify--targetThe managed node to connect to for the session. AWS CLI referenceStart a port forwarding session to a remote host
aws ssm start-session --target "instance_id" --document-name "AWS-StartPortForwardingSessionToRemoteHost" --parameters '{"portNumber":["remote_port"],"localPortNumber":["local_port"]}'Identify--targetThe managed node to connect to for the session. AWS CLI reference--document-nameThe name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. AWS CLI reference--parametersThe values you want to specify for the parameters defined in the Session document. AWS CLI reference