Skip to content

Update required parameters passing #10

Update required parameters passing

Update required parameters passing #10

Workflow file for this run

# Test ssh connectivity through ssm
name: Test SSH Connectivity
on:
push:
branches:
- DEVOPS-2881-test-ssh-connectivity-ec2
workflow_dispatch:
jobs:
deploy:
name: Test ssh workflow
permissions:
id-token: write
contents: write
environment: dev
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::657556092833:role/midendev-GithubActionsRole
role-session-name: GithubActionsSession
- name: Run command on EC2 instance
run: |
aws ssm send-command \
--instance-ids i-0d50212756bccc552 \
--document-name "AWS-RunShellScript" \
--parameters '{"commands":["ls -lrt"]}' \
--output text \
--query "Command.CommandId"
- name: Send SSM commands
uses: peterkimzz/aws-ssm-send-command@v1
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
instance-ids: i-0d50212756bccc552
command: |
ls -lrt
df -h