Synthetics: Get S3 bucket/key location at runtime

0

Is there a way in a CloudWatch Synthetics script (nodejs) to get the S3 bucket and key location for artifacts during runtime? I see log messages like:

S3 destination for uploading artifacts determined: 
{
    "s3Bucket": "cw-syn-results-accountid-region",
    "s3Key": "canary/region/name-uuid/2021/12/28/time"
}

Can I get that bucket and key for use in my script, even if it's unofficial and may break in future canary versions?

Scott
已提問 2 年前檢視次數 312 次
1 個回答
0

There is no currently supported way to do that.

If you need that information, this currently works (testing using syn-nodejs-puppeteer-3.3):

const uploader = require('SyntheticsUploader');

await uploader.setUpUploader();
const s3Path = 's3://' + uploader.getS3Path();

It is completely unsupported, though.

AWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南