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
preguntada hace 2 años312 visualizaciones
1 Respuesta
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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas