github.com/epsagon/epsagon-go@v1.39.0/example/ddb_example/serverless.yml (about)

     1  service: example-go-app-ddb
     2  
     3  custom:
     4    TableName: golang-test-table
     5  
     6  provider:
     7    name: aws
     8    runtime: go1.x
     9    region: eu-west-1
    10    environment:
    11      EPSAGON_TOKEN: ${env:EPSAGON_TOKEN}
    12      EPSAGON_COLLECTOR_URL: ${env:EPSAGON_COLLECTOR_URL}
    13  
    14    iamRoleStatements:
    15    - Effect: "Allow"
    16      Action:
    17      - "*"
    18      Resource: "arn:aws:dynamodb:eu-west-1:*:table/golang-test-table"
    19  
    20  functions:
    21    write:
    22      handler: write/main
    23      events:
    24      - http:
    25          path: write
    26          method: post
    27      environment:
    28        TABLE_NAME: ${self:custom.TableName}
    29    write-v2:
    30      handler: write_sdk_v2/main
    31      events:
    32      - http:
    33          path: write_v2
    34          method: post
    35      environment:
    36        TABLE_NAME: ${self:custom.TableName}
    37    triggered:
    38      handler: trigger/main
    39      events:
    40      - stream:
    41          type: dynamodb
    42          batchSize: 20
    43          startingPosition: TRIM_HORIZON
    44          arn:
    45            Fn::GetAtt:
    46            - GoLangTestTable
    47            - StreamArn
    48  
    49  resources:
    50    Resources:
    51      GoLangTestTable:
    52        Type: "AWS::DynamoDB::Table"
    53        DeletionPolicy: Delete
    54        Properties:
    55          AttributeDefinitions:
    56          -
    57            AttributeName: item
    58            AttributeType: S
    59          KeySchema:
    60          -
    61            AttributeName: item
    62            KeyType: HASH
    63          ProvisionedThroughput:
    64            ReadCapacityUnits: 1
    65            WriteCapacityUnits: 1
    66          StreamSpecification:
    67            StreamViewType: NEW_IMAGE
    68          TableName: ${self:custom.TableName}