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
asked 13 days ago92 views
1 Answer
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
EXPERT
answered 12 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions