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

    Swaroop

    04/12/2022, 11:46 AM
    Hi team, We are using serverless stack with monorepo in our project, so we ended up with more than 4KB environment variables size and Lambda couldn't allow it. Is there is a way we can setup env variables for each stack?
    r
    f
    • 3
    • 4
  • d

    Daniel Gato

    04/12/2022, 11:59 AM
    Apparently, I’m stuck on
    Copy code
    deploy stack: run cdk deploy
    deploy stack: poll stack status
    deploy stack: poll stack status: {
      StackStatus: 'UPDATE_COMPLETE',
      LastUpdatedTime: 2022-04-12T08:11:52.538Z
    }
    deploy stack: poll stack status: unknown
    deploy stack: poll stack status: {
      StackStatus: 'UPDATE_COMPLETE',
      LastUpdatedTime: 2022-04-12T08:11:52.538Z
    }
    deploy stack: poll stack status: unknown
    ....
    We are 2 people experiencing the same on the same project I already tried to delete .sst and .build just in case. Edit: it worked for me but my colleague is still stuck on that for now 3h
    f
    a
    l
    • 4
    • 19
  • d

    Dan Van Brunt

    04/12/2022, 12:53 PM
    Isn’t
    esBuildConfig.define
    supposed to replace as a string? With this…
    Copy code
    const viewerRequest = new sst.Function(this, 'FunctionViewerRequest', {
      handler: 'src/viewer-request.handler',
      ...defaultOptions,
      memorySize: 128,
      timeout: cdk.Duration.seconds(5),
      bundle: {
        esbuildConfig: {
          define: {
            'process.env.PRERENDER_TOKEN': 'NOT_TELLING',
          },
        },
      },
    })
    … and this in the function…
    Copy code
    const PRERENDER_TOKEN = process.env.PRERENDER_TOKEN
    …I’m getting the error…
    "errorMessage":"NOT_TELLING is not defined"
    Which makes it look like the replacement isn’t replacing as a string?
    ""
    t
    • 2
    • 8
  • d

    Dan Van Brunt

    04/12/2022, 1:03 PM
    Core Team question…. How did you guys (core team) setup these stars in a column in GH Projects? We’re also using these beta projects and wanted this feature?
    m
    • 2
    • 14
  • h

    Harris Newsteder

    04/12/2022, 1:52 PM
    If i want to add MFA to an existing user pool, what is the recommended way of doing this? Do I need to delete the existing user pool and redeploy?
    f
    • 2
    • 3
  • a

    Art Kelly

    04/12/2022, 2:07 PM
    Hey everyone, Is there a good/proper way of handling the console as a team as it seems to currently be linked directly to the device used to deploy the app?
    t
    f
    • 3
    • 14
  • r

    ray

    04/12/2022, 3:53 PM
    Seems SST doesn't provide any wrapper on SES, so I have to use CDK directly for SES, is it correct? Thanks
    t
    f
    • 3
    • 6
  • r

    Rudi

    04/12/2022, 5:15 PM
    Hi, whats the sst equivalent to "serverless info" from the serverless framework? Maybe I overlooked it, but I'd like to list the app endpoints deployed. Thx!
    t
    f
    • 3
    • 10
  • e

    Edward Smith

    04/12/2022, 6:46 PM
    Slack search is doing me no good, but is there some type of
    onExit
    event where we could tear down resources for dev envs when process exits?
    t
    r
    c
    • 4
    • 16
  • r

    Rudi

    04/12/2022, 8:53 PM
    I see it's correctly outputing from the code .. but this console log should not be there by default right? Or at least behind a debug flag?
    t
    • 2
    • 1
  • j

    Jackson Bowe

    04/13/2022, 5:19 AM
    Hi, I've upgraded to v1.0 and can't get my Api construct working. This is the error I'm getting and the construct setup. @Frank any ideas?
    f
    • 2
    • 14
  • d

    Daniel Gato

    04/13/2022, 10:10 AM
    Adding files to bundle.copyFiles doesn’t do anything. Could this be a bug?
    Copy code
    const func = new sst.Function(
          this,
          'func',
          {
            bundle: {
              copyFiles: [
                {
                  from: 'node_modules/mymodule/myfile.ext',
                  to: '.',
                },
              ],
            },
            handler: 'src/..'
          });
    If I remove/add the bundle part I keep getting:
    Stacks: Building changes...
    Stacks: Synthesizing changes...
    Stacks: No changes to deploy.
    I would expect those files to be copied to the .sst/artifacts/…/function/ folder
    t
    • 2
    • 11
  • j

    Jędrzej Kuryło

    04/13/2022, 1:04 PM
    Is it normal that adding a single
    sst.Api
    in my stack results in 6 lambdas created in AWS?
    t
    • 2
    • 4
  • a

    Adrian Schweizer

    04/13/2022, 3:19 PM
    in the Queue tutorial, maybe you should mention to set the following, because otherwise there will be costs generated by the large number of empty receives:
    Copy code
    sqsQueue: {
       receiveMessageWaitTime: Duration.seconds(20),
    },
    t
    d
    +2
    • 5
    • 93
  • a

    Adrian Schweizer

    04/13/2022, 5:06 PM
    I could still really use a guide on what to do when deployment fails for specific reasons. I tried to add
    fifo: true
    config to an sqs queue, and now it can't deploy my project anymore. It tries to update the queue, but then it says
    Copy code
    dev3-convento-cron | UPDATE_ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | dev3-convento-cron | Export dev3-convento-cron:ExportsOutputRefReminderMailQueue696E8B23D1985592 cannot be updated as it is in use by dev3-convento-api
    and at the end it says:
    Copy code
    Stack prod-convento-cron
      Status: failed
      Error: Export prod-convento-cron:ExportsOutputFnGetAttReminderMailQueue696E8B23Arn31F9752B cannot be updated as it is in use by prod-convento-api
    b
    r
    f
    • 4
    • 24
  • a

    Adrian Schweizer

    04/13/2022, 6:19 PM
    is there a guide on how to set up custom domains without using route53, or is this not supported?
    t
    f
    • 3
    • 15
  • g

    Gabriel Araújo

    04/13/2022, 8:52 PM
    Im trying to update my project to v1: Im trying to update the api construct but i keep getting this TS error but the deploy works:
    Copy code
    Type 'Api<Record<string, ApiAuthorizer>>' is not assignable to type 'Api<Record<string, never>>'.
      Type 'Record<string, ApiAuthorizer>' is not assignable to type 'Record<string, never>'.
        'string' index signatures are incompatible.
          Type 'ApiAuthorizer' is not assignable to type 'never'.
            Type 'ApiUserPoolAuthorizer' is not assignable to type 'never'.ts(2322
    for
    Copy code
    return new sst.Api(this, "Api", {
          authorizers: {
            Authorizer: {
              type: "jwt",
              jwt: {
                issuer: "<https://myorg.us.auth0.com>",
                audience: ["UsGRQJJz5sDfPQDs6bhQ9Oc3hNISuVif"],
              }
            },
          },
          defaults: {
            authorizer: "Authorizer",
            authorizationScopes: ["user.id", "user.email"],
          },
          routes: {
            "GET /notes": "src/list.main",
            "POST /notes": {
              function: "create.main",
              authorizer: "Authorizer",
              authorizationScopes: ["user.id", "user.email"],
            }
          },
        });
    f
    t
    • 3
    • 9
  • b

    Bshr Ramadan

    04/14/2022, 5:17 AM
    Hello I am trying to move from cjs to esm I am using Apollo graphql and this error is bringing on lambda invokes:
    Copy code
    Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Cannot use GraphQLNonNull \"Boolean!\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\n<https://yarnpkg.com/en/docs/selective-version-resolutions>\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.","reason":"Error: Cannot use GraphQLNonNull \"Boolean!\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\n<https://yarnpkg.com/en/docs/selective-version-resolutions>\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities 
    and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.","promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Cannot use GraphQLNonNull \"Boolean!\" from another module or realm.","","Ensure that there is only one instance of \"graphql\" in the node_modules","directory. If different versions of \"graphql\" are the dependencies of other","relied on modules, use \"resolutions\" to ensure only one version is installed.","","<https://yarnpkg.com/en/docs/selective-version-resolutions>","","Duplicate \"graphql\" modules cannot be used at the same time since different","versions may have different capabilities and behavior. The data from one","version used in the function from another could produce confusing and","spurious results.
    I tried to use yarn resolutions like this:
    Copy code
    "resolutions": {
        "graphql": "15.5.1"
      }
    But It didn't solve the problem. I have monorepo, and I tried to unify versions of many related dependencies between repos did anyone faced this?
    d
    t
    • 3
    • 20
  • g

    Garret Harp

    04/14/2022, 3:28 PM
    Just curious what do you guys do as far as sending out a websocket message to multiple users? Unless I am blind it doesnt seem AWS has a way to batch to multiple connection ids so we have to send out a single message for every single connected user which I feel could cause issues with latency especially when we get into the multiple thousands of users connected to specific events.
    s
    a
    +3
    • 6
    • 27
  • p

    Pavan Kumar

    04/14/2022, 5:13 PM
    1. Which is the best region to choose while doing Live Lambda Development? The region which is near to developer, as it minimises delay in DynamoDB fetch(s)? 2. Is there any way to set region without specifying it in
    sst.json
    nor as
    command line
    params. For example
    .sst/stage
    is used to set stage name, which is convenient as different developer can have their own stage name without committing it to github. Likewise is there something like
    .sst/region
    so that each developer can choose the region near to him without committing it to git.
    t
    j
    • 3
    • 3
  • d

    Devin

    04/14/2022, 7:01 PM
    Non SST specific question. I have the following data in DynamoDB
    Copy code
    comicSeries: { title: 'whatevr', active: true/false }
    and then customers
    haveMany
    subscriptions that look like this
    Copy code
    subscriptions: {[{ comicTitle: 'whatevr', active: true/false }]}
    So a comic or subscription can be
    active
    . This works great 🎉 When a comicSeries becomes inactive, I want to deactivate each subscription for each customer. Realistically, I can just do this in a lambda. But isn’t this technically a use for a queue? My question is, how would you handle this in a robust way?
    t
    s
    d
    • 4
    • 11
  • s

    Seth Geoghegan

    04/14/2022, 11:44 PM
    I'm trying to use sst 1.0.0-beta20 to define an S3 bucket that triggers a lambda invocation when a file is uploaded. I'm getting an error when using the example in the docs and can't make sense of it
    t
    f
    • 3
    • 12
  • a

    Artemiy Davydov

    04/15/2022, 4:28 AM
    Hello. Does anyone know how to deploy a stack to several regions so that the application works as quickly as possible for users around the world?
    Copy code
    export default function main(app: <http://sst.App|sst.App>): void {
      app.setDefaultFunctionProps({
        runtime: "nodejs14.x",
      });
    
      for (const region of ["us-west-1", "eu-central-1"]) {
        new CoreStack(app, "core-stack", { env: { region } });
      }
    }
    Will that be enough? Or should I create a new stack for each region and share all parts of the main one? https://docs.serverless-stack.com/constructs/Api#sharing-an-api-across-stacks Do I need to use load balancer? https://docs.serverless-stack.com/constructs/v1/Api#apialbrouteprops
    d
    • 2
    • 3
  • e

    Erik Robertson

    04/15/2022, 9:31 AM
    Hello all. I am about to start working on building an automated test suite for our SST stack which essentially just exposes API endpoints. Is Jest still the recommended option even though it was pulled out of SST recently? Any recommended alternatives? Bonus question :Was wondering if anyone ever worked on a SST specific alternative that would emulate the http calls but running 100% locally calling the functions directly and therefore be super fast.
    o
    • 2
    • 2
  • d

    Damjan

    04/15/2022, 2:11 PM
    How do you make environment variables that you are passing into lambdas type safe and IDE-completeable ?
    r
    t
    • 3
    • 15
  • a

    Ashishkumar Pandey

    04/15/2022, 2:27 PM
    Any ideas how I can use custom auth flow with
    aws-api-gateway-cli-test
    ?
    f
    • 2
    • 3
  • b

    Bryan Campbell

    04/15/2022, 10:28 PM
    I tried installing a VS Code Jest extension and somewhere in the process, I can no longer run tests.
    npm run test
    and
    npx sst test
    both return the same error, “Unknown script test”. I’ve uninstalled the VSCode Jest extension, removed and reinstalled /node_modules and package-lock.json, restarted VSCode several times. Nothing seems to work. I am able to still run tests fine in another sst project. Anyone know how to get me back testing again?
    f
    • 2
    • 7
  • g

    Garret Harp

    04/16/2022, 5:55 PM
    Anyone happen to have an example repo using dynamo global tables and deploying an appsync api to each of the replicated regions? Curious about how to do this with SST and especially around setting up the domain to do latency based routing.
    t
    f
    • 3
    • 6
  • d

    Devin

    04/16/2022, 6:34 PM
    If I create an endless loop on my
    getSomeStuff
    endpoint
    Copy code
    do {
      result = dynamodb.query(paramn)
    } while (true)
    while running on sst localhost. and then I just
    cmd + c
    from that terminal. Does it kill the loop or do I need to go see the console.
    a
    • 2
    • 2
  • a

    Ashishkumar Pandey

    04/16/2022, 9:56 PM
    Any advice on how should I go about debugging 401s / 403s with regards to Auth and Api constructs?
    f
    • 2
    • 3
1...646566...83Latest