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