Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    what's the best way to emulate aws/sqs for nodejs in local env ?
    6 replies

    When passing through an object like:

    const { getSignedUrl } = require("@aws-sdk/s3-request-presigner");
    const { S3Client, DeleteObjectCommand, } = require('@aws-sdk/client-s3')
    const params = {
      Bucket: 'tp-csoa',
      Key: 'jared.json',
      Expires: '2022-06-17',
      ContentType: 'application/json'
    let command = new DeleteObjectCommand(params)
    const url = await getSignedUrl(s3Client, command)

    results in:

    date.getUTCFullYear is not a function at dateToUtcString (/var/task/node_modules/@aws-sdk/smithy-client/dist-cjs/date-utils.js:8:23)

    sorry, code sample should be using PutObjectCommand
    still the same error
    copy and paste fubar
    uggg my bad, Expires should be like Expires: new Date("2022-06-17")
    which works
    Ronique Ricketts
    I am tinkering with AWS cognito ( I am unable to use AWS Amplify) and I would like to know how do I refresh my auth tokens returned from the InitiateAuthCommand function. Any articles or examples would help. I am currently using "@aws-sdk/client-cognito-identity-provider"
    someone uses NestJs framework to communicate with SQS queue
    @BruceGitHub: yeah i do, why do you ask?
    Matthew Marcus

    Ok.. I've spent the past few hours trying to understand how to get my application working w/ a Redshift Serverless that I've created through the Console.

    I'm really not seeing how to just simply run queries from nodeJS using the @aws-sdk/client-redshift package.

    I see a LOT of commands in the docs to manage Redshift clusters.. but nothing on how to just simple say something like redshiftClient.query()?

    What am I missing?

    49 replies
    João Melo

    i'm trying to use the TranscribeStreamingClient but i'm having some issues

    const {
    } = require('@aws-sdk/client-transcribe-streaming');
    const client = new TranscribeStreamingClient({
      credentials: {
        accessKeyId: process.env.AWS_ACCESS_KEY,
        secretAccessKey: process.env.AWS_SECRET_KEY,
      region: process.env.AWS_REGION,
    async function run() {
      const audio = require('fs').createReadStream('voice.mp3', { highWaterMark: 1024 * 16 });
      const command = new StartStreamTranscriptionCommand({
        LanguageCode: 'en-US',
        MediaEncoding: 'pcm',
        MediaSampleRateHertz: 16000,
        AudioStream: (async function* () {
          for await (const chunk of audio) {
            yield { AudioEvent: { AudioChunk: chunk } };
      const response = await client.send(command);
      // Start to print response
      try {
        for await (const event of response.TranscriptResultStream) {
      catch (err) {

    but i always get

                response = new TranscribeStreamingServiceException_1.TranscribeStreamingServiceException({
    InvalidSignatureException: 'Host' or ':authority' must be a 'SignedHeader' in the AWS Authorization.

    tried different AWS accounts but got the same issue, what am i missing?

    2 replies
    SNS's ListTopics command "returns a list of the requester's topics"... I'm not finding anything that specifies what identifies the requester or marks a user as owning a topic (IAM user/role, some special permission on the topic, etc.), does anyone know if that's clarified anywhere?
    1 reply
    Miroslav Foltýn
    How does one use the @aws-sdk/types types in their own app? Eg.: I am trying to refer to the Client type but unable to do so
    1 reply
    Dustin Lennon
    does anyone know a workaround to this? aws/aws-sdk-js-v3#3813
    1 reply
    Michael Heuberger
    Hello folks - does that SDK provide a public function to validate email addresses in general?
    This to ensure email address string must be 7-bit ASCII
    Antonio Riccelli

    Is there a way to access S3 buckets using Cognito tokens (AccessToken, IdToken, RefreshToken)? I have a React/Node.js full stack app that successfully authenticates the user via Cognito using the SDK. It returns the tokens as cookies, which are then sent with each new request to the backend. Each user is added to a Cognito group with access to specific buckets, but as the SDK uses my own access credentials stored in the environmental variables, I can't rely on that. It seems that the only way is to set up a database with a list of all buckets each user has access to, and query that every time.

    Is there a better way to do this?

    4 replies
    Ismet Glumcevic
    Hi, is amplify OpenSearch the same as OpenSearch SDK client? Do we have all features, is everything fast?
    Does anyone know where I can find the V3 equivalent of this V2 function I've been looking for ages: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/IotData.html#publish-property
    2 replies
    Carlos Estarita
    Does anyone know if TypeORM https://typeorm.io/ is compatible with Amazon Athena and how to connect to that database?
    Andy Blum
    I am a little confused on what constitutes a static application for hosting purposes. Within a "static" page can a web service call be made which returns data that is then rendered client side? Can I make an assumption that as long as the server resource is not returning HTML to render, it is considered static?
    1 reply
    Hi is anyone faced the below issue?
    2 replies
    Hi, when I run s3.getObject(object).createReadStream(), will that download the file to my Lambda function storage? Or it will allow the Lambda function to read the file directly from the S3 bucket?
    If not, is there any way to create a readable stream that accesses the file directly on S3 bucket?
    1 reply

    when copying between S3 Buckets in different regions (using a command like CopyObjectCommand or CreateMultipartUploadCommand) should the S3Client be initialized with the source bucket region or the target bucket region?

    all the information i've found online pertains to the aws cli and not the sdk.

    1 reply
    Tapan Kashyap
    const bucketName = process.env.AWS_BUCKET_NAME
    const accessKeyId = process.env.AWS_ACCESS_KEY
    const secretAccessKey = process.env.AWS_SECRET_KEY
    const region = process.env.AWS_BUCKET_REGION
    const credentials = {
        accessKeyId: accessKeyId,
        secretAccessKey: secretAccessKey,
    const config = {
        region: 'us-east-1',
    const s3Client = new S3Client(config);
    export { s3Client };
    I'm using code snippet to set creds in S3Client, but it does not seem to pick it up.
    error log: Error: Resolved credential object is not valid
    the docs are pretty vague on this subject. See this: The SDK automatically detects AWS credentials set as variables in your environment and uses them for SDK requests. is this supposed to mean that it will detect the .env file or the actual shell exports?
    Tapan Kashyap
    sorry for the msg, it happened due to two typos it should process.env.AWS_ACCESS_KEY_ID there & credentials: credentials.
    1 reply
    Hi guys
    I use SDK for nodejs apps and I should deploy this app in k8s, however in k8s instead of the pair of access-key, secret-key, I should use IAM-ROLE but I do not understand how
    5 replies
    Kyaw Soe Ye
    Please let me know how to register for acm in aws sdk with using nodejs
    1 reply
    Hello guys
    any one have an idea about @aws-sdk/client-xray how its configuration is done in angular and if there is any tutorial that can help
    3 replies
    Jan Castor
    Has anyone seen this exception TooManyActiveKeysException using @aws-sdk/client-guardduty? I can't seem to find documentation for it anywhere
    Ernesto Gimeno
    Hello! I'm having problems trying to type this with generics - SendEmailCommandOutput (code inside of thread)
    8 replies
    using nodejs to connect to my bot, getting back {
    '$metadata': {
    httpStatusCode: 200,
    requestId: '3c0478a4-9e0f-4a08-a4ce-18930a94a1ba',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
    but can't get the response from the intent...
    any idea why this is not working?

    // Create an Amazon Lex service client object.
    const lexClient = new LexRuntimeServiceClient({
    region: REGION,
    endpoint: "https://runtime-v2-lex.ca-central-1.amazonaws.com",
    credentials: fromCognitoIdentityPool({
    client: new CognitoIdentityClient({ region: REGION }),
    identityPoolId: IDENTITY_POOL_ID,

    const lexParams = {
    botName: "",
    botAlias: "
    inputText: 'what is the shipping cost?',
    userId: "uid12345", // For example, 'chatbot-demo'.

    try {
    const data = lexClient.send(new PostTextCommand(lexParams)).then( (data) => {
    }, (error) => {
    } catch (err) {
    console.log("Error responding to message. ", err);

    nvm had to attach a policy to the role
    solved it
    An Yu
    Hi, I have a basic question -- does the v3 SDK take care of refreshing auth tokens for you? Or does that need to be manually handled?
    2 replies
    An Yu
    Jose Carlos Ramos Carmenates
    Hey, Anybody know Where are an example for the SNSClientV3? Thanks!
    1 reply
    Ernesto Gimeno
    Hello, do you know if there are types for SES event notification?
    1 reply
    Christopher Buecheler
    hey all, I am upgrading some V2 stuff to V3 and am wondering what the equivalent of AWS.util.uuid is with the new module-specific approach? There isn't a "util" package or anything similar that I can find. I'd prefer not to import the entire v2 SDK if I can avoid it. I suppose I could use a 3rd party package, but it feels like the SDK probably provides this somewhere