AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'mard2p API 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: DeleteByAccountid: Type: Api Properties: Path: '/accounts/delete/{accountid}' Method: delete GetByAccountid: Type: Api Properties: Path: '/accounts/{accountid}' Method: get Get: Type: Api Properties: Path: '/accounts/list' Method: get Post: Type: Api Properties: Path: '/accounts/create' Method: post PutByAccountid: Type: Api Properties: Path: '/accounts/update/{accountid}' Method: put 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 DepositFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteByDepid: Type: Api Properties: Path: '/deposits/delete/{depid}' Method: delete GetByDepid: Type: Api Properties: Path: '/deposits/{depid}' Method: get Get: Type: Api Properties: Path: '/deposits/list' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-deposit' Handler: src/main/js/handlers/deposit.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 DepositFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ DepositFunction}' RetentionInDays: 7 PaymentFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteByPayid: Type: Api Properties: Path: '/payments/delete/{payid}' Method: delete GetByPayid: Type: Api Properties: Path: '/payments/{payid}' Method: get GetByRefAccountid: Type: Api Properties: Path: '/payments/{ref_accountid}' Method: get Get: Type: Api Properties: Path: '/payments/list' Method: get Post: Type: Api Properties: Path: '/payments/create' Method: post PutByPayid: Type: Api Properties: Path: '/payments/update/{payid}' Method: put Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-payment' Handler: src/main/js/handlers/payment.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 PaymentFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ PaymentFunction}' RetentionInDays: 7 TransferFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteByTransferid: Type: Api Properties: Path: '/transfers/delete/{transferid}' Method: delete GetByTransferid: Type: Api Properties: Path: '/transfers/{transferid}' Method: get Get: Type: Api Properties: Path: '/transfers/list' Method: get Post: Type: Api Properties: Path: '/transfers/create' Method: post PutByTransferid: Type: Api Properties: Path: '/transfers/update/{transferid}' Method: put Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-transfer' Handler: src/main/js/handlers/transfer.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 TransferFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ TransferFunction}' RetentionInDays: 7 ValidationFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Post: Type: Api Properties: Path: '/validations' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-validation' Handler: src/main/js/handlers/validation.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 ValidationFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ ValidationFunction}' RetentionInDays: 7 WithdrawFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteByWdwid: Type: Api Properties: Path: '/withdraws/delete/{wdwid}' Method: delete GetByWdwid: Type: Api Properties: Path: '/withdraws/{wdwid}' Method: get Get: Type: Api Properties: Path: '/withdraws/list' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-withdraw' Handler: src/main/js/handlers/withdraw.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 WithdrawFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ WithdrawFunction}' 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' DepositFunction: Description: The name of the Lambda function for the Deposit model Value: !Ref DepositFunction Export: Name: !Sub '${AWS::StackName}-functions-Deposit' DepositFunctionRole: Description: The name of the Lambda function role for the Deposit model Value: !Ref DepositFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Deposit' PaymentFunction: Description: The name of the Lambda function for the Payment model Value: !Ref PaymentFunction Export: Name: !Sub '${AWS::StackName}-functions-Payment' PaymentFunctionRole: Description: The name of the Lambda function role for the Payment model Value: !Ref PaymentFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Payment' TransferFunction: Description: The name of the Lambda function for the Transfer model Value: !Ref TransferFunction Export: Name: !Sub '${AWS::StackName}-functions-Transfer' TransferFunctionRole: Description: The name of the Lambda function role for the Transfer model Value: !Ref TransferFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Transfer' ValidationFunction: Description: The name of the Lambda function for the Validation model Value: !Ref ValidationFunction Export: Name: !Sub '${AWS::StackName}-functions-Validation' ValidationFunctionRole: Description: The name of the Lambda function role for the Validation model Value: !Ref ValidationFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Validation' WithdrawFunction: Description: The name of the Lambda function for the Withdraw model Value: !Ref WithdrawFunction Export: Name: !Sub '${AWS::StackName}-functions-Withdraw' WithdrawFunctionRole: Description: The name of the Lambda function role for the Withdraw model Value: !Ref WithdrawFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Withdraw'