Slide 41
Slide 41 text
41
Copyright © 2024 BeeX Inc. All Rights Reserved.
AWS DDKを利用したデータパイプライン構築例
const ddkBucket = ddk.S3Factory.bucket(this, "DDK Bucket", {
eventBridgeEnabled: true,
});
const firehoseS3Stage = new ddk.FirehoseToS3Stage(this, "DDK Firehose S3", {
s3Bucket: ddkBucket,
dataOutputPrefix: "raw/",
});
const sqsLambdaStage = new ddk.SqsToLambdaStage(this, "DDK SQS Lambda", {
lambdaFunctionProps: {
code: lambda.Code.fromAsset("./lambda"),
handler: "index.lambda_handler",
runtime: lambda.Runtime.PYTHON_3_9,
layers: [
lambda.LayerVersion.fromLayerVersionArn(
this,
"SDK for Pandas Lambda Layer",
`arn:aws:lambda:${
cdk.Stack.of(this).region
}:336392948345:layer:AWSSDKPandas-Python39:1`
),
],
},
});
ddkBucket.grantReadWrite(sqsLambdaStage.function);
new ddk.DataPipeline(this, "Data Pipeline", {})
.addStage({
stage: firehoseS3Stage,
})
.addStage({
stage: sqsLambdaStage,
});
※以下AWS DDK Workshopの実装内容から引用
Build a data pipeline