Hi all,
I have upgraded from 1.0 RC2 to v1.0 today.
I am using the same yaml file, but on deploy, I get the following error:
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: ApiGatewayResourceV1TestsIdVar
- Another resource with the same parent already has
this name: {id}.
Can anyone help me troubleshoot this? I have taken a look at the CF update template, but I am not an expert and can’t see what is going wrong.
In my yaml file, I have this
readrow:
handler: functions/readrow/handler.handler
events:
- http:
path: v1/tests/{id}
method: get
authorizer: authorization
integration: lambda
request:
template:
"application/json": "{\n \"id\": \"$input.params('id')\", \n \"body\" : $input.json('$'),\n \"headers\": {\n #foreach($param in $input.params().header.keySet())\n \"$param\": \"$util.escapeJavaScript($input.params().header.get($param))\" #if($foreach.hasNext),#end\n\n #end\n },\n \"queryParams\": {\n #foreach($param in $input.params().querystring.keySet())\n \"$param\": \"$util.escapeJavaScript($input.params().querystring.get($param))\" #if($foreach.hasNext),#end\n\n #end\n },\n \"pathParams\": {\n #foreach($param in $input.params().path.keySet())\n \"$param\": \"$util.escapeJavaScript($input.params().path.get($param))\" #if($foreach.hasNext),#end\n\n #end\n } \n}\n\n"
cors:
origins:
- ${self:custom.stages.${opt:stage, self:provider.stage}.vars.URL-Access-Control-Allow-Origin}
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
Any tips on where to look next? what does “Another resource with the same parent already has this name”?
Should I do something to the yaml now that I’m off RC2 and on v1.0?
cheers,
Chris.