简体   繁体   English

将文件从 AWS CodeBuild 传输到 AWS 外部的远程 linux 服务器

[英]Transfer files from AWS CodeBuild to a remote linux server outside of AWS

I have a Linux server that is not hosted by AWS.我有一个不是由 AWS 托管的 Linux 服务器。 Now, I want to use AWS CodePipeline and CodeBuild to build my CI/CD workflow.现在,我想使用 AWS CodePipeline 和 CodeBuild 来构建我的 CI/CD 工作流程。 During the build phase with CodeBuild, I wan't to transfer the build result files to my remote Linux server.在使用 CodeBuild 的构建阶段,我不想将构建结果文件传输到我的远程 Linux 服务器。 I know I can do this using scp <source> <destination> over SSH.我知道我可以通过 SSH 使用scp <source> <destination>来做到这一点。 But I don't know how to store the SSH keys in CodeBuild.但我不知道如何在 CodeBuild 中存储 SSH 密钥。 Is this possible?这可能吗?

Yes it is possible.对的,这是可能的。

You keep the secret (SSH private key) in AWS Secrets Manager or Parameter Store.您将密钥(SSH 私有密钥)保存在 AWS Secrets Manager 或 Parameter Store 中。 CodeBuild has native support to fetch these secrets safely and they will never be echoed anywhere. CodeBuild 原生支持安全地获取这些秘密,它们永远不会在任何地方得到回应。 See this StackOverflow response: How to retrieve Secret Manager data in buildspec.yaml请参阅此 StackOverflow 响应: 如何在 buildspec.yaml 中检索 Secret Manager 数据

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

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