Use the TemplateBody by default it exist
serverless cli use the PUT + TemplateBody + TemplateURL to upload cloudformation template This fix try to get the TemplateBody from the request first, if not exist, fetch the one from s3 bucket
This commit is contained in:
parent
553d074241
commit
6e6ed28d79
@ -49,3 +49,4 @@ Moto is written by Steve Pulec with contributions from:
|
|||||||
* [Michael van Tellingen](https://github.com/mvantellingen)
|
* [Michael van Tellingen](https://github.com/mvantellingen)
|
||||||
* [Jessie Nadler](https://github.com/nadlerjessie)
|
* [Jessie Nadler](https://github.com/nadlerjessie)
|
||||||
* [Alex Morken](https://github.com/alexmorken)
|
* [Alex Morken](https://github.com/alexmorken)
|
||||||
|
* [Clive Li](https://github.com/cliveli)
|
||||||
|
@ -221,13 +221,12 @@ class CloudFormationResponse(BaseResponse):
|
|||||||
stack_name = self._get_param('StackName')
|
stack_name = self._get_param('StackName')
|
||||||
role_arn = self._get_param('RoleARN')
|
role_arn = self._get_param('RoleARN')
|
||||||
template_url = self._get_param('TemplateURL')
|
template_url = self._get_param('TemplateURL')
|
||||||
|
stack_body = self._get_param('TemplateBody')
|
||||||
if self._get_param('UsePreviousTemplate') == "true":
|
if self._get_param('UsePreviousTemplate') == "true":
|
||||||
stack_body = self.cloudformation_backend.get_stack(
|
stack_body = self.cloudformation_backend.get_stack(
|
||||||
stack_name).template
|
stack_name).template
|
||||||
elif template_url:
|
elif not stack_body and template_url:
|
||||||
stack_body = self._get_stack_from_s3_url(template_url)
|
stack_body = self._get_stack_from_s3_url(template_url)
|
||||||
else:
|
|
||||||
stack_body = self._get_param('TemplateBody')
|
|
||||||
|
|
||||||
parameters = dict([
|
parameters = dict([
|
||||||
(parameter['parameter_key'], parameter['parameter_value'])
|
(parameter['parameter_key'], parameter['parameter_value'])
|
||||||
|
Loading…
Reference in New Issue
Block a user