Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamo Stream Support #2

Open
dodgeblaster opened this issue Aug 24, 2019 · 4 comments
Open

Dynamo Stream Support #2

dodgeblaster opened this issue Aug 24, 2019 · 4 comments

Comments

@dodgeblaster
Copy link
Contributor

Would it make sense to support streams in this component, or add that functionality with another? For example, we could add streams to the createTable method in utils.js:

async function createTable({ dynamodb, name, attributeDefinitions, keySchema, isStreamActive }) {
  const res = await dynamodb
    .createTable({
      TableName: name,
      AttributeDefinitions: attributeDefinitions,
      KeySchema: keySchema,
      BillingMode: 'PAY_PER_REQUEST',
      StreamSpecification: {
        StreamEnabled: isStreamActive,
        StreamViewType: NEW_IMAGE 
      }
    })
    .promise()
  return res.TableDescription.TableArn
}
@eahefnawy
Copy link
Member

This would definitely belong in this component and we would love to have that. How do you think this would look like as YAML inputs? 🤔

@dodgeblaster
Copy link
Contributor Author

we could just have an optional flag:

myTable:
  component: '@serverless/aws-dynamodb'
  inputs:
    attributeDefinitions:
      - AttributeName: id
        AttributeType: S
    keySchema:
      - AttributeName: id
        KeyType: HASH
    region: us-east-1
    stream: true

@ryanwalters
Copy link

I think it might be useful to allow people to set the type of stream, which would make this more flexible.

Maybe something like:

myTable:
  component: '@serverless/aws-dynamodb'
  inputs:
    attributeDefinitions:
      - AttributeName: id
        AttributeType: S
    keySchema:
      - AttributeName: id
        KeyType: HASH
    region: us-east-1
    streamViewType: NEW_IMAGE

@mstn
Copy link

mstn commented Dec 4, 2019

What about triggers? I would add triggers and necessary access roles here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants