integration/resources/templates/single/basic_api_with_mode.yaml (34 lines of code) (raw):

Resources: MyApi: Type: AWS::Serverless::Api Properties: StageName: MyNewStageName Mode: overwrite TestFunction: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: python3.11 AutoPublishAlias: live InlineCode: | import json def handler(event, context): return {'statusCode': 200, 'body': json.dumps('Hello World!')} Events: Get: Type: Api Properties: Path: /get Method: get RestApiId: !Ref MyApi Put: Type: Api Properties: Path: /put Method: put RestApiId: !Ref MyApi Outputs: ApiEndpoint: Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/MyNewStageName" Metadata: SamTransformTest: true