Skip to content

Instantly share code, notes, and snippets.

@em-shea
Last active September 21, 2022 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save em-shea/6bb329131999eb7a40e6b6c27d84e6ff to your computer and use it in GitHub Desktop.
Save em-shea/6bb329131999eb7a40e6b6c27d84e6ff to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An example deployment for migrating data between DynamoDB tables
Resources:
ExistingTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: ExportDataTable
AttributeDefinitions:
- AttributeName: SubscriberEmail
AttributeType: S
KeySchema:
- AttributeName: SubscriberEmail
KeyType: HASH
BillingMode: PAY_PER_REQUEST
ProvisionedThroughput:
ReadCapacityUnits: 0
WriteCapacityUnits: 0
NewTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: ImportDataTable
AttributeDefinitions:
- AttributeName: PK
AttributeType: S
- AttributeName: SK
AttributeType: S
- AttributeName: GSI1PK
AttributeType: S
- AttributeName: GSI1SK
AttributeType: S
KeySchema:
- AttributeName: PK
KeyType: HASH
- AttributeName: SK
KeyType: RANGE
GlobalSecondaryIndexes:
- IndexName: GSI1
KeySchema:
- AttributeName: GSI1PK
KeyType: HASH
- AttributeName: GSI1SK
KeyType: RANGE
Projection:
ProjectionType: ALL
BillingMode: PAY_PER_REQUEST
ProvisionedThroughput:
ReadCapacityUnits: 0
WriteCapacityUnits: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment