简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM