InputFormat Class
The format of the source data.
Example
ts
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.dynamoDBJson(),
bucket,
keyPrefix: 'prefix',
},
});
python
import aws_cdk as cdk
import aws_cdk.aws_s3 as s3
# bucket: s3.IBucket
app = cdk.App()
stack = cdk.Stack(app, "Stack")
dynamodb.Table(stack, "Table",
partition_key=dynamodb.Attribute(
name="id",
type=dynamodb.AttributeType.STRING
),
import_source=dynamodb.ImportSourceSpecification(
compression_type=dynamodb.InputCompressionType.GZIP,
input_format=dynamodb.InputFormat.dynamo_db_json(),
bucket=bucket,
key_prefix="prefix"
)
)
java
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.s3.*;
IBucket bucket;
App app = new App();
Stack stack = new Stack(app, "Stack");
Table.Builder.create(stack, "Table")
.partitionKey(Attribute.builder()
.name("id")
.type(AttributeType.STRING)
.build())
.importSource(ImportSourceSpecification.builder()
.compressionType(InputCompressionType.GZIP)
.inputFormat(InputFormat.dynamoDBJson())
.bucket(bucket)
.keyPrefix("prefix")
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK;
using Amazon.CDK.AWS.S3;
IBucket bucket;
var app = new App();
var stack = new Stack(app, "Stack");
new Table(stack, "Table", new TableProps {
PartitionKey = new Attribute {
Name = "id",
Type = AttributeType.STRING
},
ImportSource = new ImportSourceSpecification {
CompressionType = InputCompressionType.GZIP,
InputFormat = InputFormat.DynamoDBJson(),
Bucket = bucket,
KeyPrefix = "prefix"
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"
var bucket IBucket
app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))
dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
PartitionKey: &Attribute{
Name: jsii.String("id"),
Type: dynamodb.AttributeType_STRING,
},
ImportSource: &ImportSourceSpecification{
CompressionType: dynamodb.InputCompressionType_GZIP,
InputFormat: dynamodb.InputFormat_DynamoDBJson(),
Bucket: *Bucket,
KeyPrefix: jsii.String("prefix"),
},
})
Initializer
ts
new InputFormat()
python
InputFormat()
java
new InputFormat()
csharp
new InputFormat()
go
NewInputFormat()
Methods
csv(options?: CsvOptions): InputFormat // chainable@staticmethod def csv(options: typing.Optional[CsvOptions] = None) -> InputFormatpublic static InputFormat csv(CsvOptions options)public static InputFormat Csv(CsvOptions? options = null)func Csv(Options CsvOptions) InputFormatstatic#CSV format.
dynamoDBJson(): InputFormat // chainable@staticmethod def dynamo_db_json() -> InputFormatpublic static InputFormat dynamoDBJson()public static InputFormat DynamoDBJson()func DynamoDBJson() InputFormatstatic#DynamoDB JSON format.
ion(): InputFormat // chainable@staticmethod def ion() -> InputFormatpublic static InputFormat ion()public static InputFormat Ion()func Ion() InputFormatstatic#Amazon Ion format.