Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    BruceGitHub
    @BruceGitHub
    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)

    JaredAAT
    @JaredAAT
    sorry, code sample should be using PutObjectCommand
    still the same error
    copy and paste fubar
    JaredAAT
    @JaredAAT
    uggg my bad, Expires should be like Expires: new Date("2022-06-17")
    which works
    Ronique Ricketts
    @RoniqueRicketts
    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"
    BruceGitHub
    @BruceGitHub
    someone uses NestJs framework to communicate with SQS queue
    mentos1386
    @tine:tjo.space
    [m]
    @BruceGitHub: yeah i do, why do you ask?
    Matthew Marcus
    @RavenHursT

    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
    @jlvcm

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

    const {
      TranscribeStreamingClient,
      StartStreamTranscriptionCommand,
    } = 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) {
          console.log(JSON.stringify(event));
        }
      }
      catch (err) {
        console.log('error');
        console.log(err);
      }
    }
    
    run();

    but i always get

    node_modules/@aws-sdk/client-transcribe-streaming/dist-cjs/protocols/Aws_restJson1.js:380
                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
    Dan
    @schmidtDTN
    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
    @Erbenos
    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
    @dustin-lennon
    does anyone know a workaround to this? aws/aws-sdk-js-v3#3813
    1 reply
    Michael Heuberger
    @binarykitchen
    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
    @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
    @IsmetGlumcevic
    Hi, is amplify OpenSearch the same as OpenSearch SDK client? Do we have all features, is everything fast?
    Ghost
    @ghost~630775a46da03739849bc42e
    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
    @DesignsSyfte_twitter
    Does anyone know if TypeORM https://typeorm.io/ is compatible with Amazon Athena and how to connect to that database?
    Andy Blum
    @andy188_gitlab
    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
    anudeepchscitara
    @anudeepchscitara
    Hi is anyone faced the below issue?
    2 replies
    Jafar
    @abazeed
    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
    jmkozko
    @jmkozko

    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
    @T4P4N
    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',
        credentials,
    }
    
    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
    @T4P4N
    sorry for the msg, it happened due to two typos it should process.env.AWS_ACCESS_KEY_ID there & credentials: credentials.
    1 reply
    BruceGitHub
    @BruceGitHub
    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
    @kyawsoeye0_gitlab
    Please let me know how to register for acm in aws sdk with using nodejs
    1 reply
    SimonZeidan
    @SimonZeidan
    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
    @jancastor
    Has anyone seen this exception TooManyActiveKeysException using @aws-sdk/client-guardduty? I can't seem to find documentation for it anywhere
    Ernesto Gimeno
    @egimenos
    Hello! I'm having problems trying to type this with generics - SendEmailCommandOutput (code inside of thread)
    8 replies
    davd
    @david238
    lex
    hi
    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) => {
    console.log(data);
    }, (error) => {
    console.error(error);
    });
    } catch (err) {
    console.log("Error responding to message. ", err);
    }

    davd
    @david238
    nvm had to attach a policy to the role
    solved it
    An Yu
    @an_yu_twitter
    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
    @an_yu_twitter
    Jose Carlos Ramos Carmenates
    @jramoscarmenates_gitlab
    Hey, Anybody know Where are an example for the SNSClientV3? Thanks!
    1 reply
    Ernesto Gimeno
    @egimenos
    Hello, do you know if there are types for SES event notification?
    1 reply
    Christopher Buecheler
    @cwbuecheler
    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