interface CsvOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.DynamoDB.CsvOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#CsvOptions |
![]() | software.amazon.awscdk.services.dynamodb.CsvOptions |
![]() | aws_cdk.aws_dynamodb.CsvOptions |
![]() | aws-cdk-lib » aws_dynamodb » CsvOptions |
The options for imported source files in CSV format.
Example
import * as cdk from 'aws-cdk-lib';
import * as s3 from 'aws-cdk-lib/aws-s3';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack');
declare const bucket: s3.IBucket;
new dynamodb.Table(stack, 'Table', {
partitionKey: {
name: 'id',
type: dynamodb.AttributeType.STRING,
},
importSource: {
compressionType: dynamodb.InputCompressionType.GZIP,
inputFormat: dynamodb.InputFormat.csv({
delimiter: ',',
headerList: ['id', 'name'],
}),
bucket,
keyPrefix: 'prefix',
},
});
Properties
Name | Type | Description |
---|---|---|
delimiter? | string | The delimiter used for separating items in the CSV file being imported. |
header | string[] | List of the headers used to specify a common header for all source CSV files being imported. |
delimiter?
Type:
string
(optional, default: use comma as a delimiter.)
The delimiter used for separating items in the CSV file being imported.
Valid delimiters are as follows:
- comma (
,
) - tab (
\t
) - colon (
:
) - semicolon (
;
) - pipe (
|
) - space (
)
headerList?
Type:
string[]
(optional, default: the first line of the CSV file is treated as the header)
List of the headers used to specify a common header for all source CSV files being imported.
NOTE: If this field is specified then the first line of each CSV file is treated as data instead of the header. If this field is not specified the the first line of each CSV file is treated as the header.