From 828f2c6aaae9e05b019af895bfa6d0452a59d8cb Mon Sep 17 00:00:00 2001 From: Ankit-clouddrove Date: Wed, 28 Feb 2024 01:30:23 +0530 Subject: [PATCH] feat: Adding readme file for AWSSSMSendCommand.yml GitHub action file --- docs/AWSSSMSendCommand.md | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 docs/AWSSSMSendCommand.md diff --git a/docs/AWSSSMSendCommand.md b/docs/AWSSSMSendCommand.md new file mode 100644 index 00000000..1e7f7302 --- /dev/null +++ b/docs/AWSSSMSendCommand.md @@ -0,0 +1,49 @@ +## Running the bash commands on ec2 instance without SSH + +## Requirements + +- To utilize this action, you must configure your IAM user with the AWS IAM Role "AmazonSSMFullAccess". +- EC2 instance needs to be associated with an IAM Role that includes the "AmazonSSMFullAccess" policy. + + +#### [running bash command without ssh workflow](https://github.com/clouddrove/github-shared-workflows/blob/feat/docker-scanner/.github/workflows/AWSSSMsendCommand.yml) + +- This workflow is used to run the bash commands on Ec2 instance without ssh and Send the Notification to the particular slack channel after the completion of github-action using the Slack Webhook url. + +#### Usage + +- This action helps you to execute remote bash command for AWS EC2 instance without SSH or other accessing. Also send the Notification to Slack channel after the completion of GitHub-action whether its (Pass, fail or cancelled.) + +#### Example for running the bash commands on ec2 instance without SSH and send notification to Slack channel. + +````yaml +name: Bash commands without ssh +permissions: + contents: read + packages: write + pull-requests: write + +on: + workflow_dispatch: + +jobs: + bash-commands-without-ssh: + uses: clouddrove/github-shared-workflows/.github/workflows/AWSSSMSendCommand.yml@master + with: + working-directory: # Specify the working directory for the job + slack_message: # Message to be sent to Slack + slack_icon: # Icon for Slack message + slack_username: # Username for Slack message + slack_footer: # Footer for Slack message + slack_color: # Color for Slack message + slack-notification: # Enable or disable Slack notifications (example 'true' or 'false') + command: |- + # Add your bash commands here + + secrets: + AWS_REGION: # AWS region for authentication + AWS_ACCESS_KEY_ID: # AWS access key ID for authentication + AWS_SECRET_ACCESS_KEY: # AWS secret access key for authentication + INSTANCE_ID: # ID of the instance for the bash commands + SLACK_WEBHOOK_URL: # Webhook URL for sending messages to Slack +```` \ No newline at end of file