https://serverless-stack.com/ logo
Join Slack
Powered by
# guide
  • k

    Klaus

    05/21/2022, 1:01 AM
    I was looking into tagging the DebugStack the same way as the normal stack tried using key values from a
    .env
    file. While all worked as expected for my normal stack, the tags were missing in the DebugStack. The reason for that is the changed run directory during debug stack initialization, which means the environment isn't behaving as I expected.
    f
    • 2
    • 3
  • j

    Jirawat Uttayaya

    05/23/2022, 10:28 AM
    Just downloaded and tested SST last night. Liking it a lot so far. Noticed some small updates with the docs that can help first time devs/ops
    m
    f
    • 3
    • 5
  • n

    Neil Balcombe

    05/23/2022, 1:31 PM
    Off the back of a discussion about not using Cognito for auth, I'm running through the Auth0 tutorial and have come across a bug. When outputting the stack outputs,
    Copy code
    IdentityPoolId: auth.cognitoCfnIdentityPool.ref
    is not recognised. I had to change to
    IdentityPoolId: auth.cognitoIdentityPoolId ? auth.cognitoIdentityPoolId : "none",
    To get it to work correctly.
    m
    m
    • 3
    • 4
  • k

    Klaus

    05/23/2022, 7:17 PM
    @Frank @Jay Would you also be interested in a guide how to specify a custom bucket for CDK assets? This was another one of my pain points before as we might have many projects. The serverless framework allowed using 1 customizable deployment bucket for all. The current documentation covers an option for debug payloads, but not for the general CDK deployment bucket that's used for all other assets.
    f
    • 2
    • 8
  • r

    Rudi

    05/23/2022, 8:09 PM
    I tried this:
    Copy code
    export default function main(app) {
      app.setDefaultFunctionProps({
        runtime: "nodejs16.x",
        srcPath: "backend",
        bundle: {
          format: "esm",
        },
      })
    
      const storageStack = new StorageStack(app, "storage")
    
      app.stack(storageStack).stack(ApiStack)
    }
    but now get:
    Copy code
    Stacks: Building changes...
    Stacks: Synthesizing changes...
    
    TypeError: fn is not a function
        at stack (/home/rudi/projects/notes/node_modules/@serverless-stack/resources/src/FunctionalStack.ts:23:19)
        at App.stack (/home/rudi/projects/notes/node_modules/@serverless-stack/resources/src/App.ts:389:17)
        at Object.main (/home/rudi/projects/notes/stacks/index.js:19:7)
        at Object.<anonymous> (/home/rudi/projects/notes/.build/run.js:94:16)
        at Module._compile (internal/modules/cjs/loader.js:1063:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
        at Module.load (internal/modules/cjs/loader.js:928:32)
        at Function.Module._load (internal/modules/cjs/loader.js:769:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
        at internal/main/run_main_module.js:17:47
    t
    k
    • 3
    • 70
  • m

    manitej

    05/25/2022, 3:12 AM
    The demo notes app is also updated to V1, check it out: https://github.com/serverless-stack/demo-notes-app
    r
    • 2
    • 12
  • m

    manitej

    05/26/2022, 5:26 PM
    The Auth0 example has been updated to V1 and it now includes a React frontend to call APIs. 👉 https://serverless-stack.com/examples/how-to-add-jwt-authorization-with-auth0-to-a-serverless-api.html Thanks @Ashishkumar Pandey for the tips!
    a
    • 2
    • 1
  • k

    Klaus

    05/27/2022, 12:19 PM
    @Frank @thdxr I noticed problem with the documented custom configuration for Python functions https://github.com/serverless-stack/serverless-stack/blob/master/packages/resources/src/Function.ts#L471-L491 Pip seems to expect not just the indexes, but also a command
    f
    • 2
    • 5
  • p

    p0wl

    05/27/2022, 12:24 PM
    Hey, we are running our full production setup on AWS-CDK without SST currently. We’re very interested into using SST for development, but would not want to touch our production setup. Is there a guide how to / is anyone using SST for development only, but using “pure” aws-cdk for production?
    k
    f
    • 3
    • 5
  • t

    Tonny (sstNerd)

    05/28/2022, 7:11 AM
    I’m getting troubles getting started with the Apollo guide, https://serverless-stack.com/examples/how-to-create-an-apollo-graphql-api-with-serverless.html Looks like the config changed recently and playground is not longer supported.
    f
    s
    • 3
    • 9
  • m

    Mischa Spiegelmock

    05/28/2022, 8:35 PM
    how do you pass vars like cognito user pool, appsync url, etc from serverless infra to nextjs? is this the best way to do it? https://docs.serverless-stack.com/constructs/NextjsSite#environment-variables are there any helpers for reading in the vars or should i make my own?
    f
    • 2
    • 2
  • m

    Mischa Spiegelmock

    05/28/2022, 11:15 PM
    starter repo linked here is 404 https://docs.serverless-stack.com/advanced/monorepo-project-structure
    f
    • 2
    • 6
  • m

    manitej

    05/30/2022, 4:14 PM
    New week, new example! React + SST + Facebook OAuth 🔥 sst full https://serverless-stack.com/examples/how-to-add-facebook-login-to-your-cognito-user-pool.html
    t
    f
    • 3
    • 3
  • n

    Neil Balcombe

    05/31/2022, 2:51 PM
    Folks, a quick heads-up that the postgres example has quite a few issues. I've fixed a few along the way but now I'm into type errors within KyselyTypeGenerator.js. It looks like the base setup has been changed to typescript but the rest of the content hasn't.
    f
    • 2
    • 12
  • b

    Bob Wall

    05/31/2022, 4:58 PM
    Copy code
    // Show the endpoint in the output
      stack.addOutputs({
        BucketName: bucket.bucketName,
      });
    f
    • 2
    • 1
  • j

    Jan Nylund

    06/05/2022, 12:04 PM
    Howdy! I’m new on SST, coming from Serverless Framework and now considering if I should go with SST or pure CDK. One thing I’m wondering about is how SST sees the difference of monolith lambdas vs microservice? I couldn’t find any comments on it in the documentation. My aim is to primarily code in python. So if I wanna deploy say 5 different functions, is there a nice structure on how to manage this to get separate requirements.txt files for them etc? Or am I overocmplicating things.
    f
    • 2
    • 14
  • t

    Tony J

    06/09/2022, 4:12 AM
    https://serverless-stack.com/chapters/dynamically-generate-social-share-images-with-serverless.html Hi! Quick question about this guide. Since there is a cloudfront distribution with TTL of a year. There is no need to save the captured images to an s3 bucket right? Without the s3 component but with the same cloudfront configuration it would get run once, image would be captured on the fly and returned, and the result would be cached by cloudfront for a year so the api would never trigger again for the same social card request? Or is there something I'm missing? Just wondering because this guide is great and we're going to use it but the s3 + cloudfront felt like doing the same thing twice in terms of permanent caching
    f
    • 2
    • 1
  • a

    Andrew Brown

    06/09/2022, 7:35 PM
    https://serverless-stack.com/examples/how-to-create-a-websocket-api-with-serverless.html Is this one still up to date?
    f
    • 2
    • 10
  • d

    Devin

    06/09/2022, 11:07 PM
    Request: A guide for how to turn on TS for the application you’ve made if you followed the guide. With React, I can just take it piecemeal and add TS gradually. Does the same apply on the Backend, are there packages I need to add etc…
    f
    j
    • 3
    • 3
  • m

    mickey phoenix

    06/13/2022, 9:47 PM
    I’ve been working on an SST app for the last while, teaching myself mostly from the Docs and the Guide, and there are some real pain points that I keep running into: 1. A lot of the docs are in the Archives section, and tend to be somewhere between unhelpful and actively confusing — but there’s nothing on the pages themselves to indicate that they’ve been archived. I’ve literally taken to keeping the overall guide page open, and doing a quick command-F with the title of a page to see if it’s in the Archive section, because it’s the fastest way to be sure I’m not reading obsolete documentation! 2. The docs, especially the Archives docs, frequently fail to distinguish between Serverless Stack and Serverless Framework. For example, this page, which is in the Archives section under “Serverless Framework”, nonetheless does not have the word “Archive” or the word “Framework” anywhere on it. In fact, it’s not until halfway down the page, when it starts giving instructions on how to update
    serverless.yml
    , that it even begins to be clear that it’s about Serverless Framework rather than modern SST. 3. No breadcrumbs or section-based organization for the Archives pages. From a given Archives page, such as the above, there’s no way to tell what section of the guide it’s located under, other than the aforementioned “open up the table of contents and search for the page title”. It would be extremely helpful to have either or both of: a. Breadcrumbs at the top, like `Archives > Serverless Framework > Building a Serverless API > Add a list all the notes API”. b. A side nav bar that displays the guide section hierarchy, auto-expanded to the currently open page. i. Note that the current right-side nav bar does not auto-expand, does not highlight the current page, and shows up on pages (e.g. this one) that are not actually indexed from it at all. 4. Consistent use of “Serverless Stack”/“SST” and “Serverless Framework” language. a. Section titles like “BUILDING A SERVERLESS API” are actively confusing, when we are dealing with two such similarly named frameworks. b. Some pages, such as this one, are under really obscure or even misleading sections of the guide. This page is about storing secrets securely using Serverless Framework — but it’s in the “Best Practices” section of the (archived) guide, and nowhere in the section title, the other page titles, or the page itself is “Serverless Framework” explicitly mentioned. 5. The “Search” feature on docs.serverless-stack.com appears to only search the v1 constructs, even if one is currently on a v0 constructs page. This makes the search function effectively useless for those of us who are on v0. I understand that this is a “me problem” — but it would be great if the search function were context-aware, or at least offered the v0 search results (appropriately tagged) rather than suppressing them. 6. It would be great if all of the v0 constructs pages had the same warning at the top that the main “v0 Constructs” has (i.e., “_CAUTION This is the SST v0.x Constructs doc. SST v1 is now released. If you are using v1, see the v1 Constructs doc. If you are looking to upgrade to v1, check out the migration steps._“). It would help people who accidentally ended up in the wrong version to figure out what had happened to them. Without that header, it’s really easy not to notice that the URL has changed from “…constructs/v0/Api” to “…constructs/Api” or vice versa.
    a
    y
    +2
    • 5
    • 4
  • m

    Mirza

    06/15/2022, 5:38 AM
    There are npm install commands all over the guide (v7.2) without the --save or --save-dev flags like:
    Copy code
    npm install bootstrap react-bootstrap react-icons
    These should probably be corrected to include --save/--save-dev in the future?
    a
    • 2
    • 2
  • m

    Mirza

    06/15/2022, 6:01 AM
    In the guide (v7.2) on page 176 there is the following: Find the <Routes> block in src/Routes.js and add it as the last line in that section.
    Copy code
    { 
    /* Finally, catch all unmatched routes */ 
    }
    <Route path="*" element={<NotFound />} />;
    The code above makes it look like you are meant to include the curly braces and the "Finally..." comment in your Routes.js file as well which is not the case.
    a
    • 2
    • 2
  • f

    Frank

    06/16/2022, 3:22 PM
    I haven’t done something like this, but I’d imagine u need to deploy an AppSync API in each region.
    m
    b
    • 3
    • 4
  • d

    David Shunfenthal

    06/16/2022, 7:45 PM
    Hi, I have a style/TS question. The guide suggests here creating a convenience DB-interaction object (in the
    libs/dynamodb-lib.js
    file) essentially acting as a DAO. Is this more convenient this way rather than having a standard JS class containing the same methods and a constructor for
    client
    ? I’m used to seeing domain-driven interfaces for DAO’s and it feels weird to write an interface for a convenience object like this that I can use in my domain logic, but I definitely want to understand the benefits. Thanks!
  • m

    Mirza

    06/17/2022, 12:35 PM
    In the guide there is a reference to the following on page 347
    Copy code
    import debug from "../libs/debug-lib";
    However, the reference should be to ../util/debug as per page 345
    Copy code
    Create a backend/util/debug.js file from your project root with the following
    There is a further reference to debug-lib on page 349.
    Copy code
    Note that, the handler-lib.js needs to be imported before we import anything else. This is
    because the debug-lib.js that it imports needs to initialize AWS SDK logging before it's used
    anywhere else.
    I think the handler-lib and debug-lib references got cross contaminated from the serverless app instructions from pages 578 and onwards.
    j
    • 2
    • 1
  • m

    Mirza

    06/19/2022, 11:31 AM
    @thdxr I've converted the notes app demo to Typescript for anyone that needs it: https://github.com/mpandzo/serverless-stack-demo-notes-app-ts
    p
    m
    • 3
    • 4
  • t

    T Indie

    06/20/2022, 11:09 AM
    Outdated url to the starter repo in https://docs.serverless-stack.com/advanced/monorepo-project-structure
    f
    • 2
    • 4
  • t

    Tamás Krasser

    06/21/2022, 7:25 AM
    This tutorial and repo has a typo. This line should be:
    queueUrl: queue.queueUrl,
    f
    • 2
    • 1
  • t

    Tamás Krasser

    06/23/2022, 6:27 AM
    Where can I find an example repo using sst1.0 and a few stacks working together (aka “real world example”)? I’m new to this and want to see what’s the recommended way to structure a real-world project. E.g.: I have a system with a pattern where I have multiple instances of something like this: A Function produces jobs for a Queue, another Function consumes these messages. The producer Function runs every night (with the help of a Cron) but can also be triggered through an Api call. The Architecture section suggests I should have an Api, a Queue and a Cron stack, but it would make it harder to see the connections, wouldn’t it? How to split them into multiple files?
    t
    • 2
    • 3
  • r

    Rodrigo Del Canto

    06/23/2022, 6:07 PM
    Hello, Can anyone provide guidance or maybe a repo (if exists) ? to learn more about a correct/recommended way to configure and architect with SST a Next.js + Cognito Auth + api gw and lambdas (project). please!
    f
    • 2
    • 6