Unable to validate cloudformation template on S3

Issue #42 resolved
Yohei Onishi created an issue

I am trying to validate a cloudformation template on S3.

I tried the following procedure on AWS. Of course, it works.

$ wget https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/LAMP_Single_Instance.template
$ aws mb s3://1234567-bucket
$ aws s3 cp LAMP_Single_Instance.template s3://1234567-bucket
upload: ./LAMP_Single_Instance.template to s3://1234567-bucket/LAMP_Single_Instance.template
$ aws s3 ls s3://1234567-bucket
2017-07-03 16:31:09      19440 LAMP_Single_Instance.template
$ aws s3 presign s3://1234567-bucket/LAMP_Single_Instance.template
https://1234567-bucket.s3.amazonaws.com/LAMP_Single_Instance.template?AWSAccessKeyId=xxx&Signature=xxx&Expires=1499067976
$ curl https://1234567-bucket.s3.amazonaws.com/LAMP_Single_Instance.template?AWSAccessKeyId=xxx&Signature=xxx&Expires=1499067976
{
  "AWSTemplateFormatVersion" : "2010-09-09",
....
$ aws cloudformation validate-template --template-url=https://1234567-bucket.s3.amazonaws.com/LAMP_Single_Instance.template

If I tried it on localstack. It does not work.

$ wget https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/LAMP_Single_Instance.template
$ aws --endpoint-url=http://localhost:4572 s3 mb s3://1234567-bucket
$ aws --endpoint-url=http://localhost:4572 s3 cp LAMP_Single_Instance.template s3://1234567-bucket
upload: ./LAMP_Single_Instance.template to s3://1234567-bucket/LAMP_Single_Instance.template
$ aws --endpoint-url=http://localhost:4572 s3 ls s3://1234567-bucket
2017-07-03 16:57:57      19440 LAMP_Single_Instance.template
$ aws --endpoint-url=http://localhost:4572 s3 presign s3://1234567-bucket/LAMP_Single_Instance.template
http://localhost:4572/1234567-bucket/LAMP_Single_Instance.template?AWSAccessKeyId=xxx&Signature=xxx&Expires=1499068731
$ curl http://localhost:4572/1234567-bucket/LAMP_Single_Instance.template?AWSAccessKeyId=xxx&Signature=xxx&Expires=1499068731
{
  "AWSTemplateFormatVersion" : "2010-09-09",
....
$ aws --endpoint-url=http://localhost:4581 cloudformation validate-template --template-url=http://localhost:4572/1234567-bucket/LAMP_Single_Instance.template
Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>\n'

Comments (7)

  1. Log in to comment