def view_cloudformation_template(request, template_name): context = dict(request.session) region = request.session.get('region', REGION) cloudformation = boto.cloudformation.connect_to_region(region) context['template'] = simplejson.dumps(cloudformation.get_template(template_name)).replace("\\n", "\n").replace("\\\"",'"') context['template_name'] = template_name return render_to_response('cloudformation_template_view.html', context)
def get_cloudformation_template(request, template_name): region = request.session.get('region', "") cloudformation = boto.cloudformation.connect_to_region(region) return cloudformation.get_template(template_name)["GetTemplateResponse"]["GetTemplateResult"]["TemplateBody"]