Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-dynamodb-table-multi-gsis

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-dynamodb-table-multi-gsis

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
Maintainers
1
Weekly downloads
 
Created
Source

@aws-cdk/aws-dynamodb + multi GSIs update capability

This construct is fixing https://github.com/aws/aws-cdk/issues/12246 by simply overriding @aws-cdk/aws-dynamodb Table addGlobalSecondaryIndex which will leverage the @aws-cdk/custom-resource Provider to sequentially create Global GSIs.

Usage

Use @aws-cdk/aws-dynamodb as usual except for Table that needs to come from aws-dynamodb-table-multi-gsis :

import { AttributeType, BillingMode } from '@aws-cdk/aws-dynamodb';
import * as cdk from '@aws-cdk/core';

// Import the new version of Table
import { Table } from 'aws-dynamodb-table-multi-gsis';

const app = new cdk.App();

const stack = new cdk.Stack(app, 'integ-dynamodb-table');

const testTable = new Table(stack, 'TestTable', {
  partitionKey: { name: 'id', type: AttributeType.STRING },
  billingMode: BillingMode.PAY_PER_REQUEST,
});

testTable.addGlobalSecondaryIndex({
  indexName: 'global1',
  partitionKey: { name: 'global1', type: AttributeType.STRING },
});

testTable.addGlobalSecondaryIndex({
  indexName: 'global2',
  partitionKey: { name: 'global2', type: AttributeType.STRING },
});

Potential caveat

If the existing table already has

  • 1 GSI, it will delete it and recreate it with new way of managing GSIs ...
  • 2 or more GSIs, update will fail because it will try to delete those GSIs and recreate them with the new method but since it's not possible to delete more than one using the old management system the stack update will fail :( => workaround delete those GSIs from your cdk app before changing to new implementation

Keywords

FAQs

Package last updated on 25 Feb 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc