12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- # 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 <your-s3-bucket-name>
- #
- # aws cloudformation deploy \
- # --template-file <path-to-file/template-out.yaml \
- # --stack-name <STACK_NAME> \
- # --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://<bucket-name>/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://<bucket>/swagger.yaml #UPDATE
- StageName: Prod
- Variables:
- # NOTE: Before using this template, replace the <<region>> and <<account>> 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'
|