Api Gateway Stage Logical Id is not always following the structure `LogicalId: <api‑LogicalId><stage‑name>Stage`

0

I use AWS::Serverless::Api to define a API Gateway resource in my SAM template. As per this blog: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-generated-resources-api.html, The Stage created should have a logical ID of the format <api‑LogicalId><stage‑name>Stage. My api‑LogicalId = Api, stage-name=dev. However the CFN stack ends up with a stage logical id called ApiStage with the correct stage value dev.

This is not the main issue though. Later when I transform the API resource and try to deploy it again, it tries to create a new Logical Id ApidevStage which follows the format, but the stack fails as the it already has a resource for the same api gateway stage but with a different logical Id ApiStage. How to ensure my CFN stack sticks to the same Logical Id for Stage?

Can we explicitly create a stage resource and refer to it inside AWS::Serverless::Api

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인