[英]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.