Dynamo stream trigger not being created for a function

Following the steps as described here, the dynamodb stream trigger is not being created.

It looks like quite the straightforward recipe. I have no clue what might I be doing wrong:

the function:

translatorFunction:
  events:
    - stream:
      type: dynamodb
      arn:
        Fn::GetAtt:
          - translationsTable
          - StreamArn
      batchSize: 1

the table:

translationsTable:
  Type: AWS::DynamoDB::Table
  Properties:
    TableName: translations
    AttributeDefinitions:
      - AttributeName: id
        AttributeType: S
    KeySchema:
      - AttributeName: id
        KeyType: HASH
    ProvisionedThroughput:
      ReadCapacityUnits: 1
      WriteCapacityUnits: 1
    StreamSpecification:
      StreamViewType: KEYS_ONLY

The stream looks ok:

Hey @Birowsky, there’s a small indentation issue with your YML. The keys under stream need to be indented two additional spaces. The correct syntax is:

translatorFunction:
  events:
    - stream:
        type: dynamodb
        arn:
          Fn::GetAtt:
            - translationsTable
            - StreamArn
        batchSize: 1

For a note on why, check out this resources on nested dictionaries in YML.

4 Likes

I was just coming to make the same post and there was already a solution on the first page. How convenient!

It would be great to have this create an error rather than failing silently. I spent a lot of time trying to debug this.

2 Likes

That’s a great idea, @mrosett. Looking into how I can implement that.

Thanks @alexdebrie1 :rocket: