AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'foursquare deployment' Parameters: Env: Description: The environment name. Type: String Default: dev Resources: VenueFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/venues/explore' Method: get GetByVenueId: Type: Api Properties: Path: '/venues/{venue_id}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-venue' Handler: src/main/js/handlers/venue.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 VenueFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ VenueFunction}' RetentionInDays: 7 Outputs: VenueFunction: Description: The name of the Lambda function for the Venue model Value: !Ref VenueFunction Export: Name: !Sub '${AWS::StackName}-functions-Venue' VenueFunctionRole: Description: The name of the Lambda function role for the Venue model Value: !Ref VenueFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Venue'