Greengrass v2 upload non-file to S3 using StreamManager

0

I'm migrating our previous Greengrass v1 system to v2. We have an "upload" lambda function that's the final step for our data and its job is to upload the data to an S3 bucket. In v1 this was done with the AWS SDK using s3.putObject().

Since we're migrating to v2 it seems like a better solution to use the StreamManager to upload the data to S3. Something I don't understand though is that it seems like the only way to add the data to StreamManager is by giving it a file URL. This is the example from the docs.

const taskDefinition = new S3ExportTaskDefinition()
        .withBucket("BucketName")
        .withKey("KeyName")
        .withInputUrl("URLToFile");

The data that the upload function is operating on is coming from Redis at this point in its journey. So if I'm understanding this correctly, I'll need to get the data from Redis, write it to a file in a mounted volume of the lambda, and then give that file to the S3ExportTaskDefinition(). This seems a little involved and I'm wondering if I'm missing something here. Is there a way to simply give the StreamManager export task a buffer or string?

slynch
已提问 5 个月前186 查看次数
1 回答
1
已接受的回答

You have it correct, Stream manager's S3 upload is only for files on disk. Using Stream manager is not at all required for you to move from V1 to V2. V1 also offered the exact same Stream manager and it sounds like you weren't using it. Nothing requires you to use it now unless you're getting a benefit from it.

Cheers,

Michael

AWS
专家
已回答 5 个月前
profile picture
专家
已审核 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则