AWS::Serverless::Function RestApiId specifies the API Gateway ID that is not in this cloudformation

0
  1. We have set more than 500 resources (N lambdas and 1 API Gateway) in the cloudformation template yaml.
  2. Because there are more than 500 resources, you cannot use sam deploy to AWS
  3. We will split the resource into at least two templates and deploy them to separate cloudformation
  4. But I hope that the lambdas in these two cloudformations share the same API Gateway
  5. The actual practice is to set N lambdas and an API Gateway (testApi) in the first template yaml. The Events->getEndpoint->Properties->RestApiId of N lambdas: !Ref testApi
  6. Question, in the second lambda in template yaml, how to set RestApiId to point to testApi template
gefragt vor einem Monat104 Aufrufe
1 Antwort
0

Hi JasonKao,

please refer to this walkthrough on how to create a cross-stack reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough-crossstackref.html which will allow you to reference the API Gateway resource from the first stack in the second one.

profile pictureAWS
EXPERTE
beantwortet vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen