https://serverless-stack.com/ logo
Join SlackCommunities
Powered by
# help
  • c

    Chris Visser

    02/18/2022, 8:32 PM
    How can I make API routes work with a NextJS stack? I have a simple Rest route that accepts a get and post request. Locally it works, but when deployed, I get a HTTP 503. What am I missing?
    f
    • 2
    • 10
  • e

    Ernie Francis

    02/18/2022, 8:53 PM
    for the sst stack, there is no way to add 'UserPoolIdentityProvider' inside the Auth constructor? do i have to use AWS-CDK-LIB?
    a
    f
    • 3
    • 8
  • a

    Ashishkumar Pandey

    02/18/2022, 9:25 PM
    do I need to check in the .sst/* files into git?
    a
    • 2
    • 3
  • e

    Ernie Francis

    02/18/2022, 9:36 PM
    im having a weird issue, im getting
    Copy code
    [ERROR] 30:45.93 OAuth - Error handling auth response., [Error: attributes+required%3A+%5Bemail%5D]
    when trying to sign in to my app with google. i have the email attribute mapped from google.
    a
    • 2
    • 4
  • e

    Ernie Francis

    02/18/2022, 10:09 PM
    im aware of the sst.staticSite here: https://docs.serverless-stack.com/constructs/StaticSite. but im a bit stumped on how to pass the output to the expo app.
    f
    j
    • 3
    • 7
  • r

    Roberto Novelo

    02/19/2022, 3:58 AM
    I can't figure out why this is happening, but any
    /api
    web request will throw an HTTP 500 error and nothing will get logged in cloudwatch. It started happening after upgrading from sst
    0.59.0
    . How could I further troubleshoot this, or force logging or similar?
    f
    • 2
    • 6
  • s

    Sulaiman Baig

    02/19/2022, 4:48 AM
    I just created serverless stack project by running
    Copy code
    npx create-serverless-stack@latest notes
    after I run this command
    Copy code
    npx sst start
    I got error shown in the image. plz guide me why it is happening even I did not change any code
    g
    f
    • 3
    • 9
  • n

    Noah D

    02/19/2022, 6:58 AM
    Anyone know why my migrations might be breaking for
    RDS
    construct? Getting the following error message
    Copy code
    TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
        at new NodeError (internal/errors.js:322:7)
        at write_ (_http_outgoing.js:722:11)
        at ClientRequest.write (_http_outgoing.js:687:15)
        at C:\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\core\dist\runtime\server.js:110:25
        at Layer.handle [as handle_request] (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\layer.js:95:5)
        at next (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\route.js:137:13)
        at rawParser (C:\Users\noahd\Documents\Code\MendHealth\node_modules\body-parser\lib\types\raw.js:58:7)
        at Layer.handle [as handle_request] (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\layer.js:95:5)
        at next (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\route.js:137:13)
        at next (C:\Users\noahd\Documents\Code\MendHealth\node_modules\express\lib\router\route.js:131:14)
    143141db-f31f-4f14-b96e-2f0e1dbf4a8a ERROR Error: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' 
     Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
        at new NodeError (internal/errors.js:322:7)
        at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:814:11)
        at Loader.resolve (internal/modules/esm/loader.js:89:40)
        at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
        at Loader.import (internal/modules/esm/loader.js:177:28)
        at importModuleDynamically (internal/modules/cjs/loader.js:1028:27)
        at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
        at DynamicFileMigrationProvider.getMigrations (C:\Users\noahd\Documents\Code\MendHealth\.sst\artifacts\noah-mend-storage-stack-MendCoreDB-MigrationFunction\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\resources\dist\RDS_migrator\index.js:23226:115)
        at async Migrator.resolveMigrations_fn (C:\Users\noahd\Documents\Code\MendHealth\.sst\artifacts\noah-mend-storage-stack-MendCoreDB-MigrationFunction\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\resources\dist\RDS_migrator\index.js:22030:25)
        at async Migrator.getMigrations (C:\Users\noahd\Documents\Code\MendHealth\.sst\artifacts\noah-mend-storage-stack-MendCoreDB-MigrationFunction\Users\noahd\Documents\Code\MendHealth\node_modules\@serverless-stack\resources\dist\RDS_migrator\index.js:21889:24)
    f
    t
    j
    • 4
    • 17
  • a

    Adrian Schweizer

    02/20/2022, 5:29 PM
    Is there an easy way to use the same lib code (my own) in an SST lambda backend and react frontend (embedded in the same project) without duplicating the file? I tried importing the lib in the react code, but got an error message that it can't import code from outside its own src folder
    a
    t
    +2
    • 5
    • 14
  • a

    AR

    02/20/2022, 7:52 PM
    I'm getting up and running with the
    graphql-stack
    . leaving the rds database stack defaults as they are, i'm getting a
    Copy code
    \"message\":\"FATAL: database \\\"acme\\\" does not exist; SQLState: 3D000\"
    it looks like the aurora instance was created successfully with the DB identifier
    dev-acme-database-<cluster-id>
    when i check in the aws console. checking the SST console I also am getting a "No RDS clusters in this app" message. do I need to change that
    RDS_DATABASE
    value inside the database stack
    migrator
    function?
    t
    • 2
    • 24
  • e

    Ernie Francis

    02/20/2022, 10:28 PM
    like, i know we can do this:
    Copy code
    const table = new sst.Table(this, "Counter", {
          fields: {
            counter: sst.TableFieldType.STRING,
          },
          primaryIndex: { partitionKey: "counter" },
        });
    but that is just one field in a table, what if a field contains another object? only options i get are string, number or binary.
    f
    • 2
    • 1
  • j

    justindra

    02/21/2022, 1:29 AM
    Hey, I'm getting an issue testing out the PostgresSQL RDS Instance. I ran
    sst:deploy
    and it seems to run fine without issues, and then I ran
    sst:start
    and also seems fine. But when I go to apply the one migration I have, it's coming with this error and after looking at it, doesn't seem like it was run at all.
    Copy code
    ERROR TypeError: Unknown file extension ".ts" for /home/test-postgres/stacks/db-migrations/2022-02-20.ts 
     TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/test-postgres/stacks/db-migrations/2022-02-20.ts
        at new NodeError (internal/errors.js:322:7)
        at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:71:15)
        at Loader.getFormat (internal/modules/esm/loader.js:105:42)
        at Loader.getModuleJob (internal/modules/esm/loader.js:243:31)
        at async Loader.import (internal/modules/esm/loader.js:177:17)
        at async DynamicFileMigrationProvider.getMigrations (/home/test-postgres/.sst/artifacts/dev-klic-weather-station-StatickStack-RDSCluster-MigrationFunction/home/test-postgres/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:13236:27)
        at async Migrator.resolveMigrations_fn (/home/test-postgres/.sst/artifacts/dev-klic-weather-station-StatickStack-RDSCluster-MigrationFunction/home/test-postgres/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:12040:25)
        at async Migrator.getMigrations (/home/test-postgres/.sst/artifacts/dev-klic-weather-station-StatickStack-RDSCluster-MigrationFunction/home/test-postgres/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:11899:24)
        at async Runtime.handler (/home/test-postgres/.sst/artifacts/dev-klic-weather-station-StatickStack-RDSCluster-MigrationFunction/home/test-postgres/node_modules/@serverless-stack/resources/dist/RDS_migrator/index.js:13220:12)
    The migration file is just called
    2022-02-20.ts
    and contains the following:
    Copy code
    import { Kysely, sql } from 'kysely';
    
    export async function up(db: Kysely<any>): Promise<void> {
      await sql`CREATE EXTENSION postgis`.execute(db);
    }
    
    export async function down(db: Kysely<any>): Promise<void> {
      await sql`DROP EXTENSION extensionName;`.execute(db);
    }
    So looks like it's not transpiling that TS file before running the migration? Is this expected or is there something that I should be enabling?
    t
    f
    • 3
    • 11
  • s

    Steven Chandra

    02/21/2022, 3:04 AM
    Hi 🙂 Does somebody know how to create consumer function when using KinesisStream SST ? I need an example
    f
    • 2
    • 3
  • j

    Jack Tan

    02/21/2022, 3:51 AM
    Hey all, I'm getting this deprecated error:
    Copy code
    ERROR	(node:9) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    This happens because one of my dependencies use the deprecated Buffer (I don't know which dependencies...), and even though this error only shows up if Buffer() is used outside of node_modules, SST bundles my project, meaning my dependencies code is outside of node_modules, hence this error occurs I think. Does anyone else have this problem? Because of this, I'm constantly getting HTTP 500 when I call my API. I'm trying to disable this error but to no avail...
    f
    j
    • 3
    • 18
  • s

    Steven Chandra

    02/21/2022, 5:08 AM
    Hey @Frank Do you know how to provision DMS(Data Migration Services) using SST ? My company require me to do so, but I cant find any documentation regarding DMS on SST.
    t
    • 2
    • 4
  • g

    Greg

    02/21/2022, 7:44 AM
    Hey guys probably an easy one, but can’t seem to find it. How I can access the
    queue
    -url from within a sqs consumer? I would like to add an other message to the queue when the lambda is finished - I would like to chain commands this way. So I’m looking to achieve the following functionality . Unfortunately this doesn’t work since
    Property 'setDefaultFunctionProps' does not exist on type 'Queue'.
    Copy code
    const queue = new sst.Queue(this, "Queue", {
          consumer: {
            function: "src/consumer.main",
            consumerProps: {
              batchSize: 1,
            },
          },
        })
    
        queue.setDefaultFunctionProps({
          environment: { queueUrl: queue.sqsQueue.queueUrl },
        })
    a
    • 2
    • 8
  • m

    Mr.9715

    02/21/2022, 1:38 PM
    Hey Guys, Do we have a way to auto-generate VTL's when using AppSyncApi ? something like what aws-amplify does? Amplify is generating all default VTL's and basically overwrites the once that I modify.
    f
    n
    • 3
    • 5
  • r

    Ross Gerbasi

    02/21/2022, 3:31 PM
    Hey all, curious what strategies folks are using with SSM references when updating their stacks. We are using
    SecretValue.secretsManager
    to add secret refs into our builds but then changing the secret value will not cause a delta, which means they get out of sync. We have been using a NONCE in a
    .env
    file we can randomize to force some updates, which isn't horrible but also not great. Is there a cleaner way to ask a stack to refresh its SSM references?
    d
    • 2
    • 6
  • r

    Ross Gerbasi

    02/21/2022, 3:34 PM
    Second question 🙂 how do
    app.setDefaultFunctionProps
    an Api's
    defaultFunctionProps
    play together. For example if I added read only permission to a table at the
    app
    level, then added full permission to that same table at the
    Api
    creation level, would they merge? Maybe both are applied? Same for ENV variables, are they overridden?
    d
    t
    +2
    • 5
    • 10
  • s

    Sulaiman Baig

    02/21/2022, 4:18 PM
    I want to use Sequelize instead of dynamo DB in the serverless stack. I explore google but did not find any article which explain it. Please guide me ho to implement it.
    t
    • 2
    • 1
  • b

    Bshr Ramadan

    02/21/2022, 5:30 PM
    Hello, does creating many stacks make deployment time longer? I mean is it better to try creating constructs in same stack? or there is no difference?
    t
    • 2
    • 3
  • k

    Kristian Lake

    02/21/2022, 6:56 PM
    Hey all, quick question - with serverless what do you guys recommend for collecting emails and doing email campaigns? I liked the look of sendy but that would need to be hosted somewhere
    a
    g
    j
    • 4
    • 8
  • j

    justindra

    02/21/2022, 9:30 PM
    @thdxr Still having issues with the Aurora Postgressql example. This time just around permissions not being set properly on the function
    Copy code
    AccessDeniedException: User: arn:aws:sts::[account-id]:assumed-role/dev-StaticStack-TestFunctionServiceRole6AB-GP14VRU9OK1W/dev-StaticStack-TestFunction22AD90FC-WMZHGEQhE67G is not authorized to perform: secretsmanager:GetSecretValue on resource: arn:aws:secretsmanager:us-west-2:[account-id]:secret:AuroraClusterSecret12D1355B-B2VD4Q3XORvi-sYJj1G because no identity-based policy allows the secretsmanager:GetSecretValue action
    The stack code
    Copy code
    const cluster = new RDS(this, 'AuroraCluster', {
          engine: 'postgresql10.14',
          defaultDatabaseName: DATABASE_NAME,
          migrations: 'stacks/migrations/dist',
        });
    
        new Function(this, 'TestFunction', {
          handler: 'services/sample/index.handler',
          environment: {
            DATABASE_NAME,
            DATABASE_CLUSTER_ARN: cluster.clusterArn,
            DATABASE_SECRET_ARN: cluster.secretArn,
          },
          permissions: [cluster],
        });
    f
    j
    • 3
    • 4
  • s

    Sam Hulick

    02/21/2022, 11:17 PM
    is there a way to bundle miscellaneous files into a Lambda .zip file? in other words, I can declare an SST function and tell it to include
    /some/path/**/*
    in that function’s zip
    f
    r
    • 3
    • 12
  • g

    Garret Harp

    02/22/2022, 3:17 AM
    Does anyone know what the flow is for a cognito postConfirmation trigger is if it fails? Cant really find anything on the AWS docs unless I am blind
    g
    • 2
    • 3
  • m

    Marcos Sampaio

    02/22/2022, 3:55 AM
    hey folks, is there any example of how to add jwt authorization with auth0 using appysnyc? Pretty much like this one, but for appsync?
    f
    • 2
    • 4
  • f

    Franco Gotusso

    02/22/2022, 9:04 AM
    Hello guys, I'm trying to track down a bug, which I don't think it's SST specific but generic lambda, and I was wondering if somebody has faced a similar issue and can shade some light. Long story short, we have a small percentage of outgoing HTTP requests taking a very long time to finish, in the range of 1 to 10 seconds, no matter the host. The lambda is inside a VPC with a NAT gateway. We have integrated with Datadog, and I cannot find a pattern for it, but something that looks weird is that every single trace, short or long, contains a dns.lookup and a tcp.connect call for every HTTP call, which makes me think that connection pooling is not working.
    AWS_NODEJS_CONNECTION_REUSE_ENABLED
    is on, so I'm kinda lost here. Any idea or suggestion on where to look at? Many thanks!
    f
    • 2
    • 2
  • l

    Lucas

    02/22/2022, 10:04 AM
    Hello guys, after doing an sst start I am unable to check the sst console. The console always says "Waiting for CLI" I'm running Windows - might be the culprit ?
    n
    f
    • 3
    • 6
  • e

    Emil Styrke

    02/22/2022, 10:24 AM
    Minor issue, but I'm running an AppSync API with Python for the resolvers. When I run local dev and get a resolver crash, the output from the API doesn't show the real error, but some crash in the JS handler code:
    Copy code
    {
      "data": {
        "events": null
      },
      "errors": [
        {
          "path": [
            "events"
          ],
          "data": null,
          "errorType": "Runtime.UnhandledPromiseRejection",
          "errorInfo": null,
          "locations": [
            {
              "line": 28,
              "column": 3,
              "sourceName": null
            }
          ],
          "message": "TypeError: Cannot read property 'join' of undefined"
        }
      ]
    }
    Is this expected?
    n
    f
    • 3
    • 20
  • y

    Yap Yee Qiang

    02/22/2022, 10:51 AM
    Hey guys, anyone tried AWS S3 with Vue? I had problems going through the documentation, don’t know which to refer to. Anyone of you have experience in uploading and getting files from AWS S3 bucket with Vue, would appreciate if you could list down some resources or sample app/code. Thanks!
    r
    f
    • 3
    • 13
1...525354...83Latest