Skip to content

Cannot redeploy when using DynamoDB Streams #85

Closed
@arabold

Description

@arabold

In my project I'm using DynamoDB streams to trigger a Lambda. However the Alias plugin seems to prevent a regular redeploy of the project. Only the first deploy worked as expected.

This is the error thrown in CloudWatch during deployment (Checking Stack update progress):

An error occurred: my-project-dev - Export my-project-dev-MyTableStreamArn cannot be updated as it is in use by my-project-dev-dev.

The relevant parts of the serverless.yaml are:

# [...]

functions:
  myLambdaFunc:
    handler: handlers/myLambdaFunc.handler
    timeout: 300
    events:
      # Run once a day (midnight UTC)
      - schedule: cron(0 0 * * ? *)
      # Also trigger if anything relevant in the database changes
      - stream:
          type: dynamodb
          arn:
            Fn::GetAtt:
              - MyTable
              - StreamArn

resources:
  # AWS CloudFormation Template
  Resources:
    MyTable:
      Type: AWS::DynamoDB::Table
      DeletionPolicy: Retain
      Properties:
        StreamSpecification:
          StreamViewType: KEYS_ONLY
        AttributeDefinitions:
          - # [...]
        KeySchema:
          - # [...]
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        GlobalSecondaryIndexes:
          - # [...]

I will have to spend more time figuring out what exactly causes this problem as none of the resources are actually supposed to change during the deploy. But as for right now, it seems I cannot properly use DynamoDB streams as Lambda triggers in combination with the Alias plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions