Skip to content

Commit fa9ad25

Browse files
authored
return CloudFormation 400 errors on stack creation (localstack#444)
1 parent 326d7d6 commit fa9ad25

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

localstack/dashboard/infra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def handle(domain):
306306
details = json.loads(details)['DomainStatus']
307307
arn = details['ARN']
308308
es = ElasticSearch(arn)
309-
es.endpoint = details['Endpoint']
309+
es.endpoint = details.get('Endpoint', 'n/a')
310310
result.append(es)
311311
pool[arn] = es
312312
parallelize(handle, out['DomainNames'])

localstack/services/cloudformation/cloudformation_listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ def return_response(self, method, path, data, headers, response):
176176
# fix an error in moto where it fails with 500 if the stack does not exist
177177
return error_response('Stack resource does not exist', code=404)
178178
elif action == 'CreateStack' or action == 'UpdateStack':
179+
if response.status_code >= 400 and response.status_code < 500:
180+
return response
179181
# run the actual deployment
180182
template = template_deployer.template_to_json(req_data.get('TemplateBody')[0])
181183
template_deployer.deploy_template(template, req_data.get('StackName')[0])
182-
if response.status_code >= 400:
183-
return make_response(action)
184184

185185

186186
# instantiate listener

0 commit comments

Comments
 (0)