amazon web services - Passing multiple parameters from external file to cloudformation template and using values with ref -


i getting following error when trying create cloudformation stack using below cli command.

aws cloudformation create-stack --stack-name subodh-local-stack --template-url s3url/template.json --parameters s3url/params.json

error: awscli.argprocess.paramerror: error parsing parameter '--parameters': unable retrieve https://s3.amazonaws.com///params.json: received non 200 status code of 403 2017-08-18 01:32:31,309 - mainthread - awscli.clidriver - debug - exiting rc 255

my template.json looks -

{     "awstemplateformatversion": "2010-09-09",      "resources": {         "type": "aws::lambda::function",         "properties": {             "functionname": {                 "ref": "lambdafunctionname"             },             "handler": {                 "ref": "lambdahandler"             },             "role": {                 "ref": "lambdaexecutionrolearn"             },             "code": {                 "s3bucket": {                     "ref": "lambdasourcebucket"                 },                 "s3key": {                     "ref": "lambdasourcekey"                 }             },             "subnetid": {                 "ref": "lambdasubnetid"             },             "runtime": "nodejs4.3",             "timeout": "25",             "memorysize": "128",             "vpcconfig": "vpc-2323454f",             "securitygroupid": "sg-0sdfs17g"         }     } } 

and params.json like

[         {             "parameterkey": "lambdafunctionname",             "parametervalue": "hello-world"         },         {             "parameterkey": "lambdahandler",             "parametervalue": "index.handler"         },         {             "parameterkey": "lambdaexecutionrolearn",             "parametervalue": "arn:aws:iam::312345678910:role/lambdaexecuterole"         },         {             "parameterkey": "lambdasourcebucket",             "parametervalue": "test-lambda-functions"         },         {             "parameterkey": "lambdasourcekey",             "parametervalue": "helloworld.zip"         },         {             "parameterkey": "lambdasubnetid",             "parametervalue": "subnet-1113121f,subnet-fer333ex"         } ] 

after updating command to: aws cloudformation create-stack --stack-name test-local-stack --template-body file://c:/cli/aws/template.json --parameters file://c:/cli/aws/params.json

i error an error occurred (validationerror) when calling createstack operation: template format error: [/resources/type] resource definition malformed

i trying use ref function referring parameters passed parameters file during stack creation.

can please let me know doing wrong?

thank!

on first look, problem not related parameters. error message "template format error: [/resources/type] resource definition malformed", , think wrong:

"resources": {   "type": "aws::lambda::function",   ... } 

what want is:

"resources": {   "yourresourcename": {      "type": "aws::lambda::function",     ...   } } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -