Skip to content

Instantly share code, notes, and snippets.

@isaac-mcfadyen
Created September 19, 2021 02:06
Show Gist options
  • Save isaac-mcfadyen/fa4ce2032c7191e7e4292f67a773cd4b to your computer and use it in GitHub Desktop.
Save isaac-mcfadyen/fa4ce2032c7191e7e4292f67a773cd4b to your computer and use it in GitHub Desktop.
Pulumi DynamoDB typescript error.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
// Create an example table.
export const main_table = new aws.dynamodb.Table('main_table', {
name: `main_table`,
billingMode: 'PAY_PER_REQUEST',
hashKey: 'type',
rangeKey: 'date',
attributes: [
{
name: 'type',
type: 'S'
},
{
name: 'date',
type: 'S'
}
],
serverSideEncryption: {enabled: true}
});
// Create a TableItem (throws error).
const dynamoItem = new aws.dynamodb.TableItem(`record-${hash}`, {
tableName: main_table.name,
hashKey: main_table.hashKey,
rangeKey: main_table.rangeKey,
item: '{"type": {"S": "test"}, "date": {"S": "2021"}}'
})
@isaac-mcfadyen
Copy link
Author

Original issue (with workaround) here: pulumi/pulumi-aws#1628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment