1 Answer
- Newest
- Most votes
- Most comments
1
To help you related to add or remove some method in a specific stage in api gateway using cloudformation template, use this template
AWSTemplateFormatVersion: 2010-09-09
Description: Send a method to a specific stage and remove some methods in a stage API Gateway
Resources:
ApiGatewayRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
Name: MyRestApi
ApiGatewayMethod:
Type: AWS::ApiGateway::Method
Properties:
HttpMethod: POST
Path: /myresource
RestApiId: !Ref ApiGatewayRestApi
StageName: Prod
ApiGatewayStage:
Type: AWS::ApiGateway::Stage
Properties:
Name: Prod
RestApiId: !Ref ApiGatewayRestApi
MethodSettings:
- HttpMethod: POST
ResourcePath: /myresource
StageName: Prod
# Remove the methods that you don't want to use in the Prod stage
RemoveMethod: true
Above template helps you to create an API Gateway REST API with a POST method called /myresoure. The method is configured to be used in the prod stage of the API. The ApiGatewayStage resource then removes the POST method from the Prod stage
answered 8 months ago
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
Thank you i have multiple resouces how do i specify this resource to this stage and that resource to that stage
And Please after Removing can remove the block of code that did that