Skip to content

Commit

Permalink
feat(dynamodb): import data from the bucket (#28610)
Browse files Browse the repository at this point in the history
This PR adds support for importing data from a bucket.
This feature is not supported by `AWS::DynamoDB::GlobalTable`, so it is implemented only in the `Table` construct.

### Details of this feature
Users can create DynamoDB table using data from the bucket.
The data to be imported can be a single object or multiple objects.
This can be selected by specifying the prefix of the key.

Data format must be CSV, DynamoDB JSON, or Amazon Ion.
ZSTD or GZIP compressed data can also be imported.

For CSV files, delimiter and header can be specified as options.
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3forDynamoDB.html

In CloudFormation, use this feat as follows.
```yaml
AWSTemplateFormatVersion: "2010-09-09"
Resources:
  MyTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        -
          AttributeName: "id"
          AttributeType: "S"
      KeySchema:
        -
          AttributeName: "id"
          KeyType: "HASH"
      TableName: "myTableName"
      ImportSourceSpecification:
        InputCompressionType: NONE # GZIP | ZSTD 
        InputFormat: DYNAMODB_JSON # ION | CSV
        S3BucketSource:
          S3Bucket: cloudfs-s3
          S3KeyPrefix: db
```
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html

Closes #21825

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
sakurai-ryo committed Jan 19, 2024
1 parent 1222aaa commit 45b8398
Show file tree
Hide file tree
Showing 21 changed files with 37,135 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 45b8398

Please sign in to comment.