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
gefragt vor 2 Jahren312 Aufrufe
1 Antwort
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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen