0

I have a DynamoDB table and I need to enable a stream without lose the table data.

I can do it via web console, but I need to do using a yaml template and a cloud formation stack.

Is it possible without recreate the table?

I tried to upload the yaml of my table adding the StreamSpecification, but I get the error Resource of type 'AWS::DynamoDB::Table' with identifier 'Users' already exists.

AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: Stream

Resources:
  Users:
    Type: AWS::DynamoDB::Table
    Properties:
      StreamSpecification:
        StreamViewType: NEW_IMAGE
      KeySchema:
        - AttributeName: name
          KeyType: HASH
        - AttributeName: city
          KeyType: RANGE
      AttributeDefinitions:
        - AttributeName: name
          AttributeType: S
        - AttributeName: city
          AttributeType: S
      BillingMode: PAY_PER_REQUEST
      TableName: Users
    UpdateReplacePolicy: Retain
    DeletionPolicy: Retain

1 Answer 1

0

You have to import your existing DynamoDB table into CloudFormation first, before you can modify it from your yaml.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.