AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'bml-gen-test-application deployment' Parameters: Env: Description: The environment name. Type: String Default: dev Resources: AccountFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteById: Type: Api Properties: Path: '/accounts/{id}' Method: delete GetById: Type: Api Properties: Path: '/accounts/{id}' Method: get GetById: Type: Api Properties: Path: '/accounts/{id}/foo' Method: get Get: Type: Api Properties: Path: '/accounts' Method: get Post: Type: Api Properties: Path: '/accounts' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-account' Handler: src/main/js/handlers/account.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 AccountFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ AccountFunction}' RetentionInDays: 7 Outputs: AccountFunction: Description: The name of the Lambda function for the Account model Value: !Ref AccountFunction Export: Name: !Sub '${AWS::StackName}-functions-Account' AccountFunctionRole: Description: The name of the Lambda function role for the Account model Value: !Ref AccountFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Account'