Home > Net >  Upload files to Amazon EC2 in a private network from Github Actions
Upload files to Amazon EC2 in a private network from Github Actions

Time:10-26

As part of our workflow, we want to upload files to our Amazon EC2 instance automatically.

It's currently only allowing whitelisted IP ranges to connect over SSH. And since we are running Github actions, it seems odd to white list roughly 1500 IP ranges.

Does anyone have an intelligent solution for this?

SCP and/or rsync don't matter for us.

It's merely getting access that I need help with.

I have access to the ssh key, and I can get a hold of an admin to get temporary access to the AWS Console should I need it.

CodePudding user response:

Since the EC2 instance is in a private network, the hurdles to get Github Actions ssh access to it are many.

I would work with a decoupled architecture. Have the GitHub action upload the files to S3.

Then

Lambda can load the file onto the ec2 instance - S3 trigger for Lambda

OR

Have a process running on the ec2 instance poll for new events on the s3 bucket per SNS - S3 polling

  • Related