Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@clarityhub/serverless-dynamodb-migrations
Advanced tools
Trigger DynamoDB migrations from AWS Lambda with Serverless ⚡️
Database migrations for AWS Lambda and DynamoDB using DynamoDB Migrations.
This Serverless plugin can execute and rollback database migrations after deploys. See Usage. Forked from serverless-pg-migrations.
Heavily inspired by transmogrify. I tried to use it but encountered a lot of showstopping bugs for me, so I wrote my own, smaller and simpler version.
Notable differences from transmogrify:
The plugin assumes that migration files live in a migrations
directory inside your project.
yarn add @clarityhub/serverless-dynamodb-migrations
OR npm i --save @clarityhub/serverless-dynamodb-migrations
Define a migration handler somewhere in your project. Example:
// /migrations.js
const { up, down } = require("@clarityhub/serverless-dynamodb-migrations/handlers");
module.exports.up = up;
module.exports.down = down;
Add the plugin and handlers to your serverless.yml
:
provider:
name: aws
plugins:
- "@clarityhub/serverless-dynamodb-migrations"
functions:
up:
handler: migrations.up
timeout: 30
environment:
MIGRATION_TABLE: migrations
down:
handler: migrations.down
timeout: 30
environment:
MIGRATION_TABLE: migrations
Pass the function to the serverless deploy command to have it execute after the deploy is finished:
sls deploy --function up
You can also manually invoke the functions locally:
sls invoke local --function up
Or use the plugin directly without going through your function:
sls migrate up
sls migrate down
The provided migration handlers can be imported with const { up, down} = require("@clarityhub/serverless-dynamodb-migrations/handlers")
.
The functions need to have the environment variable MIGRATION_TABLE
set to the DynamoDB table name you want to use. If the table doesn't exist, the migrations will create the table for you. You can use resources to create one if you want though.
FAQs
Trigger DynamoDB migrations from AWS Lambda with Serverless ⚡️
We found that @clarityhub/serverless-dynamodb-migrations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.