https://serverless-stack.com/ logo
#help
Title
# help
r

Roberto Salim

03/30/2022, 3:23 AM
Hi, I updated my api stack to add a new GET endpoint (added the following line under routes under ApiGatewayV1Api.
"GET /v2/": "src/handlers/getItem/index.handler",
Prior to this I only have 1 POST endpoint and it was working fine, and after adding this line I always have this error:
Copy code
dev-roberto-api | CREATE_FAILED | AWS::Lambda::Function | apiLambdaPOSTv2new9C13E3AA | dev-roberto-api-index already exists in stack arn:aws:cloudformation:ap-southeast-1:352681053372:stack/dev-roberto-api/62bc2690-afd7-11ec-8c9b-0a3affc3188a
dev-roberto-api | CREATE_FAILED | AWS::Lambda::Function | apiLambdaGETv205ED50C9 | Resource creation cancelled
Does anyone know why or how to resolve this? Thanks in advance! 🙏
t

thdxr

03/30/2022, 3:33 AM
can you share the whole api definition
it looks like you're maybe creating 2 functions with the same name
r

Roberto Salim

03/30/2022, 4:31 AM
you’re right, it’s caused I have 2 functions with the same name. I have resolved it by fixing the naming. Thank you @thdxr
2 Views