# To deploy for the first time, and for each update, # run both of the following commands in order: # # aws cloudformation package \ # --template-file template.yaml \ # --output-template-file template-out.yaml \ # --s3-bucket # # aws cloudformation deploy \ # --template-file \ # --capabilities CAPABILITY_IAM AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: Lambda handler for API Gateway - Twilio integration Resources: LambdaFunction: Type: 'AWS::Serverless::Function' Properties: Handler: lambda_function.lambda_handler Runtime: python2.7 CodeUri: s3:///lambda_function.zip #UPDATE Description: Lambda handler for API Gateway - Twilio integration MemorySize: 256 Timeout: 60 Events: AddPhotoApi: Type: Api Properties: RestApiId: !Ref ApiGatewayApi Path: /addphoto Method: GET ApiGatewayApi: Type: AWS::Serverless::Api Properties: DefinitionUri: s3:///swagger.yaml #UPDATE StageName: Prod Variables: # NOTE: Before using this template, replace the <> and <> fields # in Lambda integration URI in the swagger file to region and accountId # you are deploying to LambdaFunctionName: !Ref LambdaFunction Outputs: ApiUrl: Description: URL of your API endpoint Value: !Join - '' - - https:// - !Ref ApiGatewayApi - '.execute-api.' - !Ref 'AWS::Region' - '.amazonaws.com/Prod'