zabuqasem/SSM Run Command
Execute commands on AWS EC2 instances via SSM — no SSH required. Supports OIDC, multi-line commands, and static credentials.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| aws-access-key-id | AWS IAM access key ID. Not required when using OIDC. | no | — |
| aws-secret-access-key | AWS IAM secret access key. Not required when using OIDC. | no | — |
| aws-session-token | AWS session token for temporary STS credentials. Not required when using OIDC or long-lived keys. | no | — |
| aws-region | AWS region where your EC2 instance lives (e.g. us-east-1). | yes | — |
| instance-ids | One or more EC2 instance IDs (max 50), newline-separated. Mutually exclusive with 'targets'; exactly one must be provided. | no | — |
| targets | Targets to run the command on, in AWS CLI format (max 5 lines, newline-separated). Each line: Key=<key>,Values=<v1>[,<v2>...] Valid keys: InstanceIds, tag:<name>, resource-groups:Name, resource-groups:ResourceTypeFilters. Example: Key=tag:env,Values=prod Mutually exclusive with 'instance-ids'; exactly one must be provided. | no | — |
| document-name | SSM document to execute. Defaults to AWS-RunShellScript (bash). Use AWS-RunPowerShellScript for Windows targets, or provide a custom document name or document ARN. The document must accept 'commands' and 'workingDirectory' parameters. | no | AWS-RunShellScript |
| command | Bash command(s) to execute. Each non-empty line runs as a separate SSM command sequentially. | no | echo $(date) >> logs.txt |
| working-directory | Absolute path on the instance where commands will execute. | no | /home/ubuntu |
| comment | Comment attached to the SSM Run Command entry (max 100 chars). | no | Executed by Github Actions |
| wait-for-output | If true, wait for the command to finish and log stdout/stderr per instance. Sets the 'output' action output. | no | false |
| wait-timeout | Maximum seconds to wait when wait-for-output is true (1-3600). Defaults to 60. | no | 60 |
Outputs
| name | description |
|---|---|
| command-id | The SSM Run Command UUID. Use with aws ssm get-command-invocation to check execution status. |
| output | Combined stdout from all targeted instances. Only set when wait-for-output is true. SSM truncates per-invocation output at 24 000 bytes. |