1 Answer
- Newest
- Most votes
- Most comments
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.
Relevant content
- asked 5 years ago
- Accepted Answerasked 9 months ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 2 years ago
After querying SAM-related documents [1], I found that the document has the following description: RestApiId: This cannot reference an AWS::Serverless::Api resource defined in another template. This also means that other RestApiId cannot be referenced in the current template.
Reference documents: [1] https://docs.amazonaws.cn/en_us/serverless-application-model/latest/developerguide/sam-property-function-api.html#sam-function-api-restapiid
Please be aware that the documentation and restriction that you linked to are specific to SAM (Serverless Application Model) with is a basically an extension of CloudFormation.
Yes, I use SAM Deploy CloudFormation.