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

    colin

    07/20/2021, 9:18 PM
    Hey all, seeking some advice from folks that have gone the SST
    ApolloApi
    route versus the SST
    AppSyncApi
    route… It seems like AppSync is pretty limiting with regards to how you can configure your resolvers i.e. if you want to run some javascript on a field resolve, it will be in a different lambda and data source, preventing any sort request batching… What was your experience on either piece of tech?
    j
    • 2
    • 1
  • s

    Santiago Kent

    07/21/2021, 1:52 AM
    Hey people! First of all, thank you for the great work you are doing here, i’m just starting to learn serverless and
    sst
    is really making it easy for me! I just started creating something, i have an API and i just now included an authorizer using cognito and configured Api to use that as default using IAM, my question now (Because i didn’t see this part on the docs) is how do i actually sign up fairly quickly on my local for testing the various lambdas, any directions or pointers are welcome here! Thank you
    f
    • 2
    • 9
  • r

    Ricardo Arancibia

    07/21/2021, 6:45 PM
    hi! I've been having a "RunTime.ImportModuleError: Unable to import module 'lambda': No module named 'src' " error when I deploy my stack which contains a lambda function written in python that is triggered by a certain event. Has anyone had this problem? My folder structure is scheduling-algorithm | |-- lib |-- |--index.js |--|-- MyStack.js |-- src |--|-- init.py |--|-- lambda.py |-- |-- init.py |-- sst.json |-- package.json
    f
    • 2
    • 22
  • m

    Muhammad Ali

    07/21/2021, 8:05 PM
    Hey everyone, I am trying to do auth chapter and registering a user via aws cli and getting following error
    Copy code
    aws cognito-idp sign-up \     
      --region us-east-1 \
      --client-id 4j2fxxxxxxxxxxxxxxxxxxxxxx \
      --username <mailto:admin@example.com|admin@example.com> \
      --password Passw0rd!
    
    An error occurred (NotAuthorizedException) when calling the SignUp operation: Unable to verify secret hash for client 4j2fxxxxxxxxxxxxxxxxxxxxxx
    Any idea?
    f
    • 2
    • 2
  • c

    Carlos Ribeiro

    07/22/2021, 1:48 PM
    Hey guys ... need help with a quick question.... Trying to setup a new Cron that kicks off every day, once a day. The job/function is in c#, so needed runtime would be dotnet3.1 .... is htis runtime supported within Crons? Tried finding reference to it, but getting a few ambiguous results ....
    r
    f
    • 3
    • 22
  • l

    Louis Barclay

    07/22/2021, 9:30 PM
    How would I add a custom Trust relationship to the ServiceRole for my Lambda functions?
    f
    • 2
    • 7
  • t

    thdxr

    07/22/2021, 10:14 PM
    How do you guys deal with API gateway endpoints that optionally require auth? Is there a way to tell the authorizer to let it pass through even if the auth header is missing? I can work around it by creating public vs private endpoints (maybe best practice) but was curious
    g
    o
    f
    • 4
    • 5
  • t

    thdxr

    07/22/2021, 10:44 PM
    I tend to use thin events in a pub/sub system. For example if an entity is created, I generally won't include the full entity details in the event, just the id. Any consumer can fetch the full entity from the db if they need it. Is this still the right approach for eventbridge? I do lose the ability of having really granular auditability since the events don't contain the entirety of what's going on. With the "infinite scale-ness" of aws it seems like optimizing with skinny events matters less
    o
    • 2
    • 4
  • u

    18IT002 SUNNY AGRAWAL

    07/23/2021, 9:39 AM
    Hello guys, Can anyone help me out here, I am new with react. Its regarding managing session variables mentioned in tutorial: https://serverless-stack.com/chapters/load-the-state-from-the-session.html So the issue I am having is I have an extra field in my db that takes care of user type so like user, employee or admin. I am creating a dynamic nav so it will be different for each type of user I have tried using context but when the page is refreshed it is getting reinitialized with the default value. Do you know any way to do it. It will be great help! P.S. I want a secure way that can’t be seen on browser or can be edited by user so I came across local storage but its not secure.
    r
    f
    j
    • 4
    • 17
  • p

    Pranav Tadikonda

    07/23/2021, 2:35 PM
    Hi everyone, I have an issue with what seems to be a runtime determined require() in mongodb’s node package… In the MongoDB node source, this code executes
    let saslprep;
    try {
    saslprep = require('saslprep');
    } catch (e) {
    // don't do anything;
    }
    and later…
    if (cryptoMethod === 'sha256' && saslprep == null) {
    emitWarningOnce('Warning: no saslprep library specified. Passwords will not be sanitized');
    }
    This causes my error monitoring to go haywire because it seems that
    saslprep
    is null due to some kind of issue with runtime imports of packages. Most Stack Overflow just says to install
    saslprep
    but that hasn’t solved the problem. Is there a way to explicitly define external dependencies like I would in a webpack config? Or any ideas how to solve this problem? Link for reference: https://stackoverflow.com/questions/53266471/saslprep-warning-when-using-mongoclient-connect/57234317#57234317
    f
    • 2
    • 7
  • g

    geekmidas

    07/23/2021, 4:33 PM
    Does anyone have any ideas on how to reduce costs on a NAT Gateway, while still keeping the VPC setup secure. Any help would be appreciated.
    t
    f
    • 3
    • 5
  • c

    Clayton

    07/23/2021, 7:25 PM
    Hey all. I have a greenfield project that we’ll be able to architect as a serverless app from the ground up. It’s a relatively simple ETL & CRUD app that will integrate with 3rd party data sources. I’m still coming up to speed on current best practices for serverless, but am leaning toward using a AppSync GraphQL API with EventBridge as the spine for events. I’m having a hard time finding good examples of using EventBridge period, let alone with a GraphQL API. I also don’t see much reference to it in SST, other than for cron jobs. A couple questions – * For an app like this would you recommend against using EventBridge or AppSync for any reason? * Do you know of any architecture examples that use EventBridge for something similar to this? * Any recommendations of best practices for using SQS or SNS in combination with EventBridge? Thanks for any insights or help.
    r
    o
    +3
    • 6
    • 36
  • m

    Muhammad Ali

    07/24/2021, 3:53 AM
    JS Noob question. Whenever i "mis-format" the file, i get some error like this
    Copy code
    18:58  error  Trailing spaces not allowed  no-trailing-spaces
    
    ✖ 1 problem (1 error, 0 warnings)
      1 error and 0 warnings potentially fixable with the `--fix` option.
    Now here are 2 questions. 1. I am using VSCode, is there a way that it can automaticlaly fix this as i save the file? 2. Which command i can use with
    --fix
    flag? I used
    serverless invoke ... ... --fix
    and it didn't work out
    t
    f
    • 3
    • 3
  • a

    Aditya Shahani

    07/24/2021, 4:01 PM
    Hi Everyone, I am new to Serverless-Stack and Serverless Framework. I am facing a CORS issue which I can’t find any solution for. I have opened a discussion on the GitHub. I would greatly appreciate anyone’s help with this. https://github.com/serverless-stack/serverless-stack/discussions/593
    I keep getting the following response in my browser from API Gateway: “Access to XMLHttpRequest at ‘https://API_ID.execute-api.us-east-1.amazonaws.com/PATH’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”
    In my response, I set the following headers:
    headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': true, 'Content-Type': 'application/json', }
    I also set 
    cors: true
     in my serverless.yml for each function defined.
    It is odd that other POST method APIs are working fine, but my GET method API keeps throwing this error. Has anyone seen this type of issue before?
    d
    f
    • 3
    • 18
  • b

    brent

    07/24/2021, 9:25 PM
    Running into a bit of a bug. I've got a
    create-react-app
    application. Seem to be able to get through deployment fine when I use
    StaticSite
    :
    Copy code
    const dashboard = new StaticSite(contentApiStack, "AuthSPA", {
        path: "../js/auth-spa/src",
        buildCommand: "yarn run build",
      });
    but when I use the fancy new
    ReactStaticSite
    :
    Copy code
    const dashboard = new ReactStaticSite(contentApiStack, "AuthSPA", {
        path: "../js/auth-spa/src",
        buildCommand: "yarn run build",
        environment: {
          REACT_APP_CONTENT_API: "...",
          REACT_APP_TINA_API_URL: "...",
          REACT_APP_BASE_HOSTNAME: "..."
        },
      });
    I'm getting:
    dev-tina-cloud-stack-content-api-stack | CREATE_FAILED | Custom::SSTBucketDeployment | AuthSPACustomResource7B33DD08 Received response status [FAILED] from custom resource. Message returned: 'NoneType' object is not iterable (RequestId: ce075f86-efb9-49f0-9edc-bf8016b57e78)
    Happy to move this into a GH issue if you'd rather!
    p
    f
    • 3
    • 11
  • c

    colin

    07/25/2021, 4:48 PM
    Hey all - getting this runtime issue when sending a graphql request to my apollo api deployed with SST. anyone seen this before??
    Copy code
    Runtime.ImportModuleError: Error: Cannot find module 'ts-tiny-invariant'
    Require stack:
    - /var/task/server.js
    - /var/runtime/UserFunction.js
    - /var/runtime/index.js
        at _loadUserApp (/var/runtime/UserFunction.js:100:13)
        at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)
        at Object.<anonymous> (/var/runtime/index.js:43:30)
        at Module._compile (internal/modules/cjs/loader.js:1085:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
        at Module.load (internal/modules/cjs/loader.js:950:32)
        at Function.Module._load (internal/modules/cjs/loader.js:790:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
        at internal/main/run_main_module.js:17:47
    f
    p
    • 3
    • 20
  • a

    Ashishkumar Pandey

    07/26/2021, 4:37 AM
    I’ve a couple of
    HttpJwtAuthorizer
    that I need to share across some stacks. I am initialising these authorizers in a separate stack called
    PreStack
    . How can I share these authorizers from
    PreStack
    so that my other stacks can refer to the same authorizers?
    f
    • 2
    • 4
  • g

    Guy Shechter

    07/26/2021, 7:33 PM
    Wondering if something has changed in this behavior? When defining an sst.Api, this works:
    Copy code
    routes: {
            'GET /': 'src/lambda.handler',
          },
    I used to be able to do this:
    Copy code
    defaultFunctionProps: {
              srcPath: 'src',
         },
         routes: {
            'GET /': 'lambda.handler',
         },
    but now, it throws an error:
    Error: Cannot find a "tsconfig.json" in the function's srcPath: /src
    f
    • 2
    • 3
  • m

    Mr.9715

    07/28/2021, 9:07 AM
    Hey guys, I am facing issue while adding JWT authorizer to http APIs. 'handler' throws 'undefined' error and rebuilding fails if I add a no auth route. I tried to swap handler with function keyword which solved the build issue but then the permissions were not attached. 😕
    s
    f
    • 3
    • 5
  • s

    Sakar

    07/28/2021, 3:34 PM
    Hi, I tried setting Custom Domain Name, every config works fine but I am unable to use the custom domain. Testing SST in local mode. Is it work only after build and deploy?
    t
    f
    p
    • 4
    • 4
  • a

    Aaron McCloud

    07/28/2021, 10:57 PM
    and in
    babel.config.js
    :
    Copy code
    //babel.config.js
    module.exports = {presets: ['@babel/preset-env']}
    f
    j
    • 3
    • 12
  • a

    Adrián Mouly

    07/30/2021, 4:10 AM
    Hello guys, Can we use async/await into SST stacks? I need to call AWS SDK and don’t want to do..
    Copy code
    ssm.getParameter(key, (err: AWS.AWSError, data: AWS.SSM.GetParameterResult)=>{
    But do this instead:
    Copy code
    await ssm.getParameter(key).promise();
    r
    f
    • 3
    • 36
  • s

    Sam Hulick

    07/30/2021, 5:54 PM
    hey folks! brand new to SST.. in fact, brand new to CDK too (I’ve been using Serverless Framework) I have a question about how to architect our stack(s). I made a new SST app called “coretest”.. and I noticed I can create multiple stacks within this. SST deploys these as
    <stage>-coretest-<stack name>
    . is this a best practice, to just have a single folder that contains all of our microservices? so basically the stacks would be
    <stage>-<app name>-<stack name>
    ?
    t
    • 2
    • 6
  • s

    Sam Hulick

    07/30/2021, 6:39 PM
    another question about devs working on Lambda funcs in their own sandboxes: one of the issues with the usual way of working w/ serverless is that while you have stages like dev, prod, etc.. it becomes tricky for multiple devs to work on the same Lambda functions, because you’d wind up deploying over each other’s work. how would this work with SST? if I do
    yarn start
    , I see I get a debug stack spun up. but what if another dev also runs
    yarn start
    ? how do we test in isolation? and (probably a tougher question to answer), how would a dev running either a local instance of a Vue app (or deployed to a preview branch) point that Vue app to use their debug/test API?
    j
    • 2
    • 14
  • s

    Sam Hulick

    07/30/2021, 7:09 PM
    how does one clean up after killing the
    start
    process? just manually delete the debug stack?
    j
    f
    • 3
    • 25
  • s

    Sam Hulick

    07/30/2021, 7:32 PM
    does SST work with Yarn 2 PnP? (no node_modules folder)
    f
    • 2
    • 2
  • s

    Sam Hulick

    07/30/2021, 8:49 PM
    @Frank @Jay thank you both for your help! what you & the team have built here is pretty incredible. maybe now we can finally put to bed the whole argument over whether serverless dev should be done locally or in the cloud 😉
    j
    • 2
    • 1
  • v

    Vishal Vijay

    08/01/2021, 7:12 AM
    Hi In SST, is it possible to use API key to authenticate lambda with API Gateway ? (Couldn’t find any reference to api key in the doc)
    a
    f
    t
    • 4
    • 13
  • v

    Vishal Vijay

    08/01/2021, 4:32 PM
    Hi Is there way we can configure import based absolute path in SST?
    f
    • 2
    • 4
  • s

    Sam Hulick

    08/01/2021, 11:12 PM
    where can we learn more about how to attach IAM permissions to certain resources in a stack, have a stack reference a resource in another stack, etc?
    f
    • 2
    • 6
1...91011...83Latest