AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'order deployment' Parameters: Env: Description: The environment name. Type: String Default: dev Resources: OrderFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteByMerchantId: Type: Api Properties: Path: '/{merchant_id}/orders' Method: delete GetByMerchantIdAndNumber: Type: Api Properties: Path: '/{merchant_id}/orders/{number}' Method: get PostByMerchantId: Type: Api Properties: Path: '/{merchant_id}/orders' Method: post PutByMerchantIdAndNumber: Type: Api Properties: Path: '/{merchant_id}/orders/{number}' Method: put Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-order' Handler: src/main/js/handlers/order.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 OrderFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ OrderFunction}' RetentionInDays: 7 Outputs: OrderFunction: Description: The name of the Lambda function for the Order model Value: !Ref OrderFunction Export: Name: !Sub '${AWS::StackName}-functions-Order' OrderFunctionRole: Description: The name of the Lambda function role for the Order model Value: !Ref OrderFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Order'