Run AWS's SSM Send-Command API using this action. Refer to AWS SDK for JavaScript v3.
- name: Run aws ssm send-command
uses: nohmad/aws-ssm-send-command-action@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
targets: |
[{"Key":"InstanceIds","Values":["i-1234567890"]}]
document-name: AWS-RunShellScript
parameters: |
{"commands":["uname -a"]}
Required. secrets.AWS_ACCESS_KEY_ID
Required. secrets.AWS_SECRET_ACCESS_KEY
Required. secrets.AWS_REGION
Currently, only the AWS-RunShellScript was tested.
Required. Specify target instances by JSON format.
[
{
"Key": "tag:Name", "Values": ["ec2-instance-name"]
},
{
"Key": "InstanceIds", "Values": ["i-1234567890"]
}
]
Required. Parameters to the document. Must be formatted as JSON:
{"commands": ["uname -a"]}
Taken from .CommandInvocations[0].Status
. Success
or Failure
CommandId
to check the details of the command executed. Run following command to see the details:
aws ssm list-command-invocations --command-id <command-id> --details
Command output
GY Noh [email protected]
MIT License