简体   繁体   English

向现有CloudFormation堆栈添加资源

[英]Add Resources to existing CloudFormation stack

I have a CloudFormation master stack. 我有一个CloudFormation主堆栈。 I want to write a tool that allows me to add Lambda functions to the master stack using Boto3. 我想编写一个工具,允许我使用Boto3将Lambda函数添加到主堆栈中。

In order to add the function to the stack I need to be able to 为了将功能添加到堆栈中,我需要能够

  • Get Outputs from the master stack to use in the function's template. 从主堆栈获取输出以在函数模板中使用。

  • Add the Function to the master stack. 将函数添加到主堆栈。

I have only been able to get this to work with: 我只能使它与:

  • Build, zip, and upload the function to S3 构建,压缩并将功能上传到S3

  • Add the function's template to the master stack's templates. 将函数的模板添加到主堆栈的模板。 (requires editing the master stack's files) (需要编辑主堆栈的文件)

  • Deploy the master stack. 部署主堆栈。

I would like to be able to create the function without editing the master stack's files. 我希望能够在不编辑主堆栈文件的情况下创建函数。

(ie boto3.get_stack_id -> boto3.add_resource_to_stack_by_stack_id ) (即boto3.get_stack_id > boto3.add_resource_to_stack_by_stack_id

Is this possible? 这可能吗? If so, how do I do it? 如果是这样,我该怎么办?

No that is not possible. 不,那是不可能的。 When updating a stack, you always have to provide a URL for the new stack template, or provide the full template body as a string, or use the previous template. 更新堆栈时,始终必须提供新堆栈模板的URL,或提供完整的模板主体作为字符串,或使用先前的模板。

Source: https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html 来源: https : //docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html

There is no API call that allows you to directly add a resource to a stack. 没有API调用可让您直接将资源添加到堆栈。

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

相关问题 将现有 AWS 资源合并到 CloudFormation 堆栈中 - Incorporate existing AWS resources into a CloudFormation stack Cloudformation 模板更新而不删除现有堆栈和资源? - Cloudformation template update without deleting the existing stack and resources? CloudFormation 堆栈资源 - CloudFormation Stack resources 如何将现有 CloudFormation 堆栈分解为单独的嵌套堆栈,将现有资源移动到嵌套堆栈下 - How to break existing CloudFormation stack into separate nested stacks, moving existing resources under nested stack 重新附加保留的 cloudformation 资源,返回到 cloudformation 堆栈 - Reattaching a retained cloudformation resources, back to a cloudformation stack 将新的输出和资源添加到现有的 AWS CloudFormation 堆栈 - Add new Output and Resource to existing AWS CloudFormation Stack 自定义资源 cloudformation 的堆栈策略 - Stack policy for custom resources cloudformation 创建没有资源的 CloudFormation 堆栈 - Create CloudFormation stack without resources 是否可以描述CloudFormation中的现有资源? - Is it possible to describe existing resources in CloudFormation? 重用现有资源作为 cloudformation 中的参数 - Reuse existing resources as a parameters in cloudformation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM