简体   繁体   English

在 AWS cloudformation 中,自定义资源和资源提供者有什么区别?

[英]In AWS cloudformation, what is the difference between a custom resource and a resource provider?

As per my understanding:根据我的理解:

  • A custom resource is just an AWS Lambda function that runs whenever the stack is provisioned or updated or deleted.自定义资源只是一个 AWS Lambda 函数,只要堆栈被预置、更新或删除,它就会运行。

  • A resource provider is plain old code where one writes hooks for all the Stack operations (update, create, delete, etc).资源提供者是普通的旧代码,其中为所有 Stack 操作(更新、创建、删除等)编写挂钩。

I can't see why anyone would use the former over the latter.我不明白为什么有人会使用前者而不是后者。 Resource providers seem easier to write and test.资源提供者似乎更容易编写和测试。

One historical reason is that custom resources were the only option until recently:一个历史原因是自定义资源直到最近都是唯一的选择:

CloudFormation Release History CloudFormation 发布历史

18 Nov 2019 Resource Provider announcement 2019 年 11 月 18 日资源提供商公告

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

相关问题 使用 AWS CDK 解决 AWS Cloudformation 中的资源相互依赖性 - Solving resource interdependencies in AWS Cloudformation, using AWS CDK Cloudformation 访问已创建的资源 - Cloudformation access a resource that was already created aws cdk 将值传递给 lambda 自定义资源 - aws cdk passing values to a lambda custom resource 无服务器错误,当自定义命名的资源需要替换时,CloudFormation 无法更新堆栈 - Serverless Error, CloudFormation cannot update a stack when a custom-named resource requires replacing 如何检查资源是否由 CloudFormation 创建? - How can I check if a resource was created by CloudFormation? Python AWS CDK 自定义资源仅在第一次执行 - Python AWS CDK Custom resource only executes the first time 如何在 CloudFormation 中包含/引用多个资源文件? - How to Include/Reference Multiple Resource files in CloudFormation? 在 CloudFormation 模板中为 API 添加资源策略? - Add resource policy for API in CloudFormation template? 无服务器框架和 CloudFormation 之间的区别? - Difference between Serverless Framework and CloudFormation? AWS Amplify 中的 currentAuthenticatedUser() 和 currentUserPoolUser() 有什么区别? - what is difference between currentAuthenticatedUser() and currentUserPoolUser() in AWS Amplify?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM