https://serverless-stack.com/ logo
Join SlackCommunities
Powered by
# sst
  • d

    Dennis Dang

    08/13/2021, 11:40 PM
    Does Seed apply incremental deploys or have some heuristics for doing so with Serverless Stack? Does Seed do this already by default for SST projects?
    f
    • 2
    • 4
  • c

    Christopher Fraser

    08/15/2021, 2:18 PM
    hi, has anyone tried using cdk pipelines with sst?
    f
    • 2
    • 9
  • c

    Christopher Fraser

    08/15/2021, 2:19 PM
    also, is it possible to configure the build output directory? i'd like to write up a nx plugin, traditionally the build output goes into a dist folder in the workspace root
    t
    • 2
    • 2
  • a

    Adrián Mouly

    08/16/2021, 12:53 AM
    @Frank maybe this changed recently? Looks like code in the Doc has a type error. From
    HttpMethod
    to
    CorsHttpMethod
    ? https://docs.serverless-stack.com/constructs/Api#configuring-cors
    f
    • 2
    • 3
  • r

    Ross Coundon

    08/16/2021, 7:44 PM
    If I define vpc property within a Function, is this meant to reference existing VPC/subnets etc or is this going to create them?
    t
    f
    • 3
    • 34
  • t

    thdxr

    08/16/2021, 11:56 PM
    What is the point of cdk-context. I just confused myself for 30min because I was wondering why
    ssm.valueFromLookup
    was giving an old value and it's because it was cached in cdk-context. Doesn't see to be a way to override this
    f
    • 2
    • 3
  • l

    Luke Wyman

    08/17/2021, 3:09 AM
    Anybody know if it's possible/how to determine what stage the deploy is running in during runtime? (as in, it could have picked up the stage from the
    sst.json
    file, or the
    --stage
    command line arg)
    a
    • 2
    • 2
  • l

    Luke Wyman

    08/17/2021, 3:35 AM
    Got a little issue here when I do my lambdas in python with sst code in Typescript. Given a Route like this:
    'POST /karaoke/rotations': 'src/services/rotations/KAR_ROT_create_rotation.lambda_handler'
    I get the following error on deploy:
    error: Could not resolve "/home/lukewyman/Documents/code/karaoke-backend-sst/src/services/rotations/KAR_ROT_create_rotation.js"
    So it's assuming it's looking for a file ending in
    .js
    when the file actually ends in
    .py
    .
    t
    a
    • 3
    • 16
  • k

    Karthik S Kumar

    08/17/2021, 9:57 AM
    Hey guys, Is there any examples for setting up sst with yarn workspaces in typescript?
    t
    g
    • 3
    • 38
  • l

    Luke Wyman

    08/17/2021, 9:22 PM
    Okay. So,
    FunctionProps
    has an attribute called
    bundle
    which can take a
    FunctionBundlePythonProps
    with this interface:
    Copy code
    export interface FunctionBundlePythonProps {
        readonly installCommands?: string[];
    }
    What are those
    installCommands
    all about? The AWS Lambda documentation for Python discusses using either a zip file or a Docker image to deploy. How might the
    installCommands
    play ball with either or both of those?
    f
    • 2
    • 2
  • a

    Adrián Mouly

    08/18/2021, 1:05 AM
    I’m using API GW v2. construct, but after having a 500 error, my service doesn’t work anymore, and start to get 503 “service unavailable”. Looks like something is blocking my API after having a 500, and from so on starting to get 503. Anybody had the same problem?
    f
    d
    • 3
    • 62
  • r

    Ross Coundon

    08/18/2021, 10:40 AM
    I think there's a bug with the output of the new
    sst update
    command. When it's run the package.json is updated to have
    Copy code
    "@aws-cdk/core": "^1.114.0",
    and
    Copy code
    "@aws-cdk/assert": "^1.114.0",
    but this causes a warning on build that the package must be the exact version. I.e. it should be (without ^)
    Copy code
    "@aws-cdk/core": "1.114.0",
    and
    Copy code
    "@aws-cdk/assert": "1.114.0",
    t
    • 2
    • 2
  • s

    Sam Hulick

    08/19/2021, 3:56 AM
    I crashed SST’s live debug 😳
    Copy code
    main ist: [Function (anonymous)]
    
    TypeError: Cannot read property 'length' of undefined
        at Object.truncate (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/lib/object.js:7:17)
        at printLambdaResponse (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:1540:58)
        at ChildProcess.<anonymous> (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:1455:5)
        at ChildProcess.emit (events.js:376:20)
        at ChildProcess.emit (domain.js:470:12)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
    a
    a
    f
    • 4
    • 23
  • g

    Guy Shechter

    08/19/2021, 4:09 AM
    I’m driving myself crazy with some CORS issues, hoping someone has had similar experience. My GET requests are resolving fine, but my POSTs are not. Any troubleshooting tips?
    a
    a
    s
    • 4
    • 17
  • s

    Sam Hulick

    08/19/2021, 5:32 AM
    feature request/enhancement: it would be nice if the error logger used
    util.inspect()
    so we can get more depth. the
    errors: [Array]
    isn’t helpful here
    Copy code
    8526a694-c552-4dd1-be61-616982184b83 ERROR Error: Network error: Response not successful: Received status code 401
        at new ApolloError (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/src/errors/ApolloError.ts:56:5)
       [snip]
    microservices/node_modules/zen-observable/lib/Observable.js:179:3) {
      graphQLErrors: [],
      networkError: {
        response: { size: 0, timeout: 0 },
        statusCode: 401,
        result: { errors: [Array] }
      }
    }
    f
    • 2
    • 3
  • a

    Adrián Mouly

    08/19/2021, 7:45 AM
    Is lambda authorizer caching working for you guys? For me, it’s caching the responses always. I’m sending different bearer JWT tokens, and is caching the response and returning always the same, even for different tokens.
    g
    f
    • 3
    • 42
  • c

    colin

    08/19/2021, 2:40 PM
    Hey guys, how have you all set your env vars for the
    sst test
    command? It doesn’t seem that having a
    .env.test
    file injects the test environment vars into the test environment but I don’t want to overwrite the jest.config under the hood.
    f
    r
    • 3
    • 6
  • f

    Frank

    08/19/2021, 5:02 PM
    Hey @gio, trying to dig into this a bit
    SST needs some speed up
    By slow, do you mean the handler function is taking long to run locally in
    sst start
    ?
    RAM reach 4gb
    Can you see which process is this? Is it
    esbuild
    ?
    g
    r
    d
    • 4
    • 29
  • a

    Adrián Mouly

    08/20/2021, 1:48 AM
    Does somebody get to configure VS Code to lint with the same config as SST? I want to get these kind of warnings on VS Code, not only on SST lint.
    34:21 warning Argument ‘value’ should be typed with a non-any type @typescript-eslint/explicit-module-boundary-types
    f
    • 2
    • 9
  • a

    Adrián Mouly

    08/20/2021, 2:12 AM
    Other question/concern… Is anybody using “Simple” Lambda Authorizer? It works fine for the most part, but this is strange… On my lambda integration, this is what I receive on the `event`:
    Copy code
    ...
    requestContext: {
        accountId: 'xxx',
        apiId: 'xxx',
        authorizer: { lambda: [Object] },
        domainName: 'xxx',
    ...
    As you can see, there is an object
    authorizer
    which has a child `lambda`… the object inside
    lambda
    it’s totally fine, it’s exactly what I expect to receive. The problem is, apparently this
    lambda
    object doesn’t exists on TS interface
    APIGatewayProxyEventV2
    . As you can see here, this is the interface definition:
    Copy code
    ...
        requestContext: {
            accountId: string;
            apiId: string;
            authorizer?: {
                jwt: {
                    claims: { [name: string]: string | number | boolean | string[] };
                    scopes: string[];
                };
            } | undefined;
            domainName: string;
            domainPrefix: string;
    ...
    Apparently the interface
    APIGatewayProxyEventV2
    only supports
    jwt
    , but not
    lambda
    ? anybody else had this issue?
    t
    • 2
    • 20
  • c

    colin

    08/20/2021, 2:50 PM
    Does anyone get this error every now and then while the live lambda env is running?
    Copy code
    There was a problem reading the build metafile [Error: ENOENT: no such file or directory, open '/Users/dev/engine/.build/.esbuild.--src-graphql-server-handler.json'] {
       errno: -2,
       code: 'ENOENT',
       syscall: 'open',
       path: '/Users/dev/engine/.build/.esbuild.--src-graphql-server-handler.json'
    }
    happens somewhat randomly and I have to restart. Might be something with a jest watcher also running
    npm test --watch
    t
    f
    • 3
    • 9
  • d

    donferi

    08/20/2021, 3:04 PM
    Are there any plans to support
    add-cdk
    and
    update
    in a project inside a workspace?
    t
    • 2
    • 5
  • t

    thdxr

    08/20/2021, 5:20 PM
    Seems like using
    $default
    can screw up cors since it looks like it's routing options requests to it (which in my case fail because it requires auth)
    f
    • 2
    • 7
  • l

    Luke Wyman

    08/20/2021, 11:46 PM
    I just experimented with deploying python lambdas. First did a
    npx create-serverless-stack@latest [proj nam] --language python
    and it worked as expected, creating a JavaScript
    MyStack
    and a Python lambda (
    lambda.py
    ). All good. Then I did an
    npx sst start
    and then checked out what goodies I made in the AWS console. I see that my Lambda got created, it's in JavaScript in the console (no Python runtime Lambdas created). Is sst converting from Python to JavaScript?
    t
    t
    • 3
    • 10
  • a

    Adrián Mouly

    08/23/2021, 9:42 PM
    Anybody else experienced this issue in Lambda? My lambda is timing out, but checking in the logs, there is nothing there… only couple of warnings, but looks like is taking long time to do the cold-start and it doesn’t log anything.
    r
    s
    • 3
    • 30
  • r

    Ryan

    08/24/2021, 3:19 AM
    Hey everyone! I was just wondering about the best practice in the
    StaticSite
    construct for running
    npm install
    before compiling the SPA? I just literally do
    npm install && npm run build
    for the
    buildCommand
    . Is there a better way? What does everyone else do?
    t
    j
    • 3
    • 10
  • s

    Sam Hulick

    08/24/2021, 3:46 AM
    I wonder if there’s any way to optimize the switching between live & debug stacks (start vs deploy). I realize it has to update the functions to inject the stub code.. but if you have 150 functions for your HTTP API, that would take a long time. I don’t know how it works under the hood, but I wonder if there’d be some way to just modify the Lambda’s code bundle and not touch CloudFormation at all, which is where the bottleneck is
    t
    f
    +2
    • 5
    • 21
  • a

    Adrián Mouly

    08/24/2021, 6:48 AM
    In these kind of examples, can you guys add the imports on top? Sometimes is hard to find where those belong to, due most of them are from CDK and there so many sub-packages. In this case, was hard to find that
    targets
    belongs to
    @aws-cdk/aws-events-targets
    .
    t
    f
    • 3
    • 10
  • r

    Ross Coundon

    08/24/2021, 1:23 PM
    We're getting an error when setting accessLogs to true on the Api construct. If we set
    accessLog: true
    in the snippet below we get the error:
    Copy code
    TypeError: Cannot read property 'api' of undefined
        at Object.buildAccessLogData (/home/jamin/Code/OFSC-forms-PDFify/node_modules/@serverless-stack/resources/src/util/apiGatewayV2AccessLog.ts:79:54)
        at new Api (/home/jamin/Code/OFSC-forms-PDFify/node_modules/@serverless-stack/resources/src/Api.ts:217:45)
        at new PdflifierStack (/home/jamin/Code/OFSC-forms-PDFify/lib/PdflifierStack.ts:97:17)
        at Object.main (/home/jamin/Code/OFSC-forms-PDFify/lib/index.ts:13:3)
        at Object.<anonymous> (/home/jamin/Code/OFSC-forms-PDFify/.build/run.js:89: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)
    
    There was an error synthesizing your app.
    It goes away if we set it to false. Any thoughts on what's going on here?
    t
    b
    • 3
    • 24
  • b

    Bhuvaneshwaran R

    08/24/2021, 2:17 PM
    Is it possible to deploy only one function even though if stack has multiple functions?
    t
    a
    • 3
    • 13
1...91011...33Latest