AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'atlas-tags 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: '/healthChecks' 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 TagFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByTagId: Type: Api Properties: Path: '/tags/{tagId}' Method: get GetByTagId: Type: Api Properties: Path: '/tags/{tagId}/objects' Method: get Post: Type: Api Properties: Path: '/tags' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-tag' Handler: src/main/js/handlers/tag.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 TagFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ TagFunction}' 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' TagFunction: Description: The name of the Lambda function for the Tag model Value: !Ref TagFunction Export: Name: !Sub '${AWS::StackName}-functions-Tag' TagFunctionRole: Description: The name of the Lambda function role for the Tag model Value: !Ref TagFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Tag'