简体   繁体   English

从 Github Actions 将文件上传到私有网络中的 Amazon EC2

[英]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.作为我们工作流程的一部分,我们希望将文件自动上传到我们的 Amazon EC2 实例。

It's currently only allowing whitelisted IP ranges to connect over SSH.它目前只允许通过 SSH 连接列入白名单的 IP 范围。 And since we are running Github actions, it seems odd to white list roughly 1500 IP ranges.由于我们正在运行 Github 操作,因此将大约 1500 个 IP 范围列入白名单似乎很奇怪。

Does anyone have an intelligent solution for this?有没有人有一个聪明的解决方案?

SCP and/or rsync don't matter for us. SCP 和/或 rsync 对我们来说无关紧要。

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.我可以访问 ssh 密钥,并且可以在需要时联系管理员以临时访问 AWS 控制台。

Since the EC2 instance is in a private network, the hurdles to get Github Actions ssh access to it are many.由于 EC2 实例位于私有网络中,因此获得 Github Actions ssh 访问权限的障碍很多。

I would work with a decoupled architecture.我会使用解耦架构。 Have the GitHub action upload the files to S3.GitHub 操作将文件上传到 S3。

Then然后

Lambda can load the file onto the ec2 instance - S3 trigger for Lambda Lambda 可以将文件加载到 ec2 实例 - Lambda 的 S3 触发器

OR或者

Have a process running on the ec2 instance poll for new events on the s3 bucket per SNS - S3 polling在 ec2 实例上运行一个进程轮询每个 SNS 的 s3 存储桶上的新事件 - S3 轮询

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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