简体   繁体   English

使用 AWS CDK 重命名 S3 文件

[英]Rename a S3 file using AWS CDK

I wish to rename a file that exists in S3 using CDK.我希望使用 CDK 重命名 S3 中存在的文件。 That's pretty much it.差不多就是这样。 The closest thing I found was BucketDeployment and it doesn't work for this purpose.我发现的最接近的东西是BucketDeployment ,它不适用于此目的。 Is there a way to do this, or should I just write a lambda?有没有办法做到这一点,或者我应该只写一个 lambda?

AWS CDK's main purpose is to provision infrastructure. AWS CDK 的主要目的是预置基础设施。 Managing the data stored on those infrastructure is an entirely different story.管理存储在这些基础设施上的数据是一个完全不同的故事。

Deploying Updates to Static Site将更新部署到 Static 站点
If the goal of this rename operation is for deployment purposes, I would suggest to just use AWS CLI, this makes release process much simpler with less risk as the underlying infrastructure is not at risk of unintentional modifications / bugs in the updates made on the infrastructure's CDK templates.如果此重命名操作的目标是出于部署目的,我建议只使用 AWS CLI,这使得发布过程更简单,风险更小,因为底层基础设施不会在基础设施的更新中面临无意修改/错误的风险CDK 模板。

This option makes mounting on a CI/CD pipeline much more simpler too!这个选项也使得在 CI/CD 管道上的安装更加简单!

Managing application data If the goal of this rename is to manage application data, I would suggest using AWS SDK for your language of choice.管理应用程序数据如果此重命名的目的是管理应用程序数据,我建议使用 AWS SDK 作为您选择的语言。

Layering automation is a subtle best practice!分层自动化是一种微妙的最佳实践! Using these automation tools for the right goal / use-cases can empower us to deliver changes quicker to customers!将这些自动化工具用于正确的目标/用例可以使我们能够更快地向客户交付更改!

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

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