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
asked 2 years ago308 views
1 Answer
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
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions