0

i am doin Amazon Stack Creation through Java Eclipse.

tis below line of code is throwing the error

csr.setTemplateURL("https://s3.amazonaws.com/cloudformation-templates-us-east-  1/AutoScalingMultiAZSample.template");

I am getting the error as :

Caught Exception: Parameters: [KeyName] must have values (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 9363d711-3535-11e4-8cf2-913ef42879cb) Reponse Status Code: 400

my json template url is https://s3.amazonaws.com/cloudformation-templates-us-east-1/AutoScalingMultiAZSample.template

Please help on this to detect the exact source of the error.

1
  • Why is there a string of blanks embedded in your URL? Is that a typo here or is it in the URL in your source? Commented Sep 5, 2014 at 20:02

1 Answer 1

1

Ok i tried to validate your json schema using online validator.

http://jsonlint.com/

I just copied your json schema and pasted there. It said invalid schema expecting { on line 1. Ok for sure i have to put opening and closing brackets and in between your schema. But again it gave error. Extra Bracket } on last line. So i had to remove it. And then json schema was validated. It means somewhere in your schema you are putting an extra closing bracket }.

I think the place where you are making mistake is:

"InstanceSecurityGroup" : {
      "Type" : "AWS::EC2::SecurityGroup",
      "Properties" : {
        "GroupDescription" : "Enable SSH access and HTTP from the load balancer only",
        "SecurityGroupIngress" : [ {
          "IpProtocol" : "tcp",
          "FromPort" : "22",
          "ToPort" : "22",
          "CidrIp" : { "Ref" : "SSHLocation"}
        },
        {
          "IpProtocol" : "tcp",
          "FromPort" : { "Ref" : "WebServerPort" },
          "ToPort" : { "Ref" : "WebServerPort" },
          "SourceSecurityGroupOwnerId" : {"Fn::GetAtt" : ["ElasticLoadBalancer", "SourceSecurityGroup.OwnerAlias"]},
          "SourceSecurityGroupName" : {"Fn::GetAtt" : ["ElasticLoadBalancer", "SourceSecurityGroup.GroupName"]}
        } ]
      }
    }//Extra Bracket i think so
  },

  "Outputs" : {
    "URL" : {
      "Description" : "The URL of the website",
      "Value" :  { "Fn::Join" : [ "", [ "http://", { "Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]}]]}
    }
  }
}
Sign up to request clarification or add additional context in comments.

1 Comment

even after removing the bracket i am getting the same error in eclipse.i validated the schema in jsonlint.com, there it is showin valid without removing the brackets.but if remove brackets then it is showin as parse error.please help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.