[英]CodePipeline/CodeDeploy move files from S3 to EC2
I'm using aws-cdk for my architecture and I need one last piece to the puzzle.我正在为我的架构使用 aws-cdk,我需要最后一块拼图。 Is it possible to move files from S3 to specific directories on the EC2 instance?
是否可以将文件从 S3 移动到 EC2 实例上的特定目录?
I have my.env file and nginx config files in an S3 bucket and once the update has rolled out using CodePipeline/CodeDeploy I want to move the files into their place.我在 S3 存储桶中有 my.env 文件和 nginx 配置文件,使用 CodePipeline/CodeDeploy 推出更新后,我想将文件移到它们的位置。 I don't want to manage these files on GitHub or by having to SSH into the instance.
我不想在 GitHub 上或通过 SSH 进入实例来管理这些文件。
// appspec.yml // 应用规范.yml
files:
- source: /
destination: /path/to/webserverdir
Can I use S3 as a source?我可以使用 S3 作为来源吗?
Can I use S3 as a source?
我可以使用 S3 作为来源吗?
Sadly, you can't.可悲的是,你不能。 You have to write bash/powershell script which is going to use AWS CLI to perform the copy from S3 to the instance.
您必须编写将使用 AWS CLI 执行从 S3 到实例的复制的bash/powershell 脚本。 Then you invoke the script as part of your
appspec.yml
.然后调用该脚本作为
appspec.yml
的一部分。 In addition to this, your instances will need to have an instance role with permissions to S3 .除此之外,您的实例将需要具有具有S3 权限的实例角色。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.