AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: Multi-type SAM template A - Function with API

Resources:
  MyApi:
    Type: AWS::Serverless::Api
    Properties:
      StageName: prod

  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs18.x
      CodeUri: s3://bucket/code.zip
      Events:
        GetItems:
          Type: Api
          Properties:
            Path: /items
            Method: get
            RestApiId: !Ref MyApi
