Created
September 19, 2021 02:06
-
-
Save isaac-mcfadyen/fa4ce2032c7191e7e4292f67a773cd4b to your computer and use it in GitHub Desktop.
Pulumi DynamoDB typescript error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}}' | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original issue (with workaround) here: pulumi/pulumi-aws#1628