heartbeat-template.yaml 1.18 KB
´╗┐AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An AWS Serverless Heartbeat receiver
Resources:
  HeartbeatLambda:
    Type: AWS::Serverless::Function
    Properties:
      Handler: org.alfresco.heartbeat.handler.HeartbeatRequestHandler
      Runtime: java8
      Description: 'Heartbeat lambda'
      MemorySize: 512
      Timeout: 15
      CodeUri: ./target/heartbeat-2.0-SNAPSHOT.jar
      Policies:
        - AmazonDynamoDBFullAccess
      Environment:
        Variables:
          TABLE_NAME:
            Ref: Table
      Events:
        PostRequest:
          Type: Api
          Properties:
            Path: /
            Method: post

  Table:
    Type: AWS::DynamoDB::Table
    Properties:
      KeySchema:
        -
          AttributeName: "repositoryId"
          KeyType: "HASH"
        -
          AttributeName: "repositoryVersion"
          KeyType: "RANGE"
      AttributeDefinitions:
        -
          AttributeName: 'repositoryId'
          AttributeType: 'S'
        -
          AttributeName: 'repositoryVersion'
          AttributeType: 'S'
      ProvisionedThroughput:
        ReadCapacityUnits: "5"
        WriteCapacityUnits: "5"