AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'common deployment' Parameters: Env: Description: The environment name. Type: String Default: dev Resources: HealthCheckFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/_internal_/healthcheck' Method: get Get: Type: Api Properties: Path: '/_internal_/probe/ready' Method: get Get: Type: Api Properties: Path: '/_internal_/probe/live' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-health-check' Handler: src/main/js/handlers/health_check.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 HealthCheckFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ HealthCheckFunction}' RetentionInDays: 7 ServiceInfoFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/_internal_/service' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-service-info' Handler: src/main/js/handlers/service_info.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 ServiceInfoFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ ServiceInfoFunction}' RetentionInDays: 7 Outputs: HealthCheckFunction: Description: The name of the Lambda function for the HealthCheck model Value: !Ref HealthCheckFunction Export: Name: !Sub '${AWS::StackName}-functions-HealthCheck' HealthCheckFunctionRole: Description: The name of the Lambda function role for the HealthCheck model Value: !Ref HealthCheckFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-HealthCheck' ServiceInfoFunction: Description: The name of the Lambda function for the ServiceInfo model Value: !Ref ServiceInfoFunction Export: Name: !Sub '${AWS::StackName}-functions-ServiceInfo' ServiceInfoFunctionRole: Description: The name of the Lambda function role for the ServiceInfo model Value: !Ref ServiceInfoFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-ServiceInfo'