https://serverless-stack.com/ logo
Join Slack
Powered by
# sst
  • s

    Sione

    03/11/2021, 8:48 PM
    I'm curious if anyone ran into the same error using sst app with typescript. I'm using typescript config
    baseUrl
    to resolve module file path relative to baseUrl . Typescript does recognized the path but it's failing on build. I wonder if this is esbuild limitation or something else. From the looks of it in .build file, the path is not being resolved.
    Copy code
    Running type checker
    Deploying stacks
    
    Error: Cannot find module 'util/domain'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
        at Function.Module._load (internal/modules/cjs/loader.js:562:25)
        at Module.require (internal/modules/cjs/loader.js:692:17)
        at require (internal/modules/cjs/helpers.js:25:18)
        at Object.<anonymous> (/Users/sionelt/projects/enterprise/lib/integrations-app.ts:10:46)
        at Module._compile (internal/modules/cjs/loader.js:778:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    f
    j
    • 3
    • 9
  • s

    Seth Geoghegan

    03/12/2021, 4:14 PM
    @thdxr you can do it like this:
    Copy code
    new sst.Function(this, "MyNamedFunction", {
          handler: "src/messages/list.handler",
          functionName: "my-funky-function". // <--- set this
        });
    f
    • 2
    • 1
  • t

    thdxr

    03/12/2021, 7:45 PM
    Copy code
    "resolutions": {
        "@serverless-stack/**/typescript": "4.2.3",
      }
    f
    j
    • 3
    • 10
  • j

    Jay

    03/14/2021, 2:20 AM
    For some of you SST pros 😉, this might be old news but somebody asked for an AppSync SST example. So I put a simple one together. If there's some interest we'll create an AppSync construct in SST to make this easier. https://github.com/jayair/appsync-sst-app
    s
    • 2
    • 2
  • t

    thdxr

    03/14/2021, 4:07 AM
    Okay some basic findings - going to thread this so I'm not spamming this channel
    j
    f
    • 3
    • 11
  • r

    Ross Coundon

    03/15/2021, 9:24 AM
    In the docs it mentions about needing a VPN for connecting to services inside a VPC. I assume this is only the case if it’s a custom VPC with services in private subnets and not the default VPC?
    c
    f
    • 3
    • 7
  • t

    thdxr

    03/16/2021, 5:54 AM
    I submitted the initial PR for the
    copyFiles
    feature but ended up not using it since I opted to package it via a layer instead
    d
    • 2
    • 4
  • d

    Dmitry Pavluk

    03/16/2021, 6:04 AM
    is there a way to turn on verbose logging from esbuild?
    • 1
    • 1
  • d

    Dmitry Pavluk

    03/16/2021, 6:48 AM
    This is interesting. My teammate is experimenting on his own branch, and even though we're deploying different stacks, they see to share the underlying debug stack. His failed b/c of a permissions issue and that has nuked my stack too
    f
    • 2
    • 4
  • c

    claudioc

    03/16/2021, 2:03 PM
    @Dmitry Pavluk from 0.9.18 it is possible to use all the predefined esbuild loaders; would it work for you to do something like
    Copy code
    import sql from './sql/seed.sql'
    
    // Do something with the sql (which is just a string)
    That’s a pretty easy setup (I can share it)
    d
    d
    • 3
    • 6
  • d

    Dmitry Pavluk

    03/16/2021, 5:02 PM
    In good news, I did get an entire Aurora Postgres cluster up and running and playing nice with the API. Combined with the debug stack, that's going to be a game changer for CI/CD
    f
    • 2
    • 22
  • t

    thdxr

    03/16/2021, 5:06 PM
    With autorunning migrations as well, going to write it up at some point
    c
    • 2
    • 1
  • d

    Dmitry Pavluk

    03/16/2021, 5:29 PM
    Nice. We actually migrated from serverless to provisioned haha
    r
    • 2
    • 1
  • t

    thdxr

    03/16/2021, 5:30 PM
    I've been going back and forth on that as well - why did you guys end up switching?
    d
    • 2
    • 5
  • t

    thdxr

    03/16/2021, 5:31 PM
    I'm excited for v2 aurora since v1 has some rough edges
    r
    • 2
    • 1
  • d

    Dmitry Pavluk

    03/18/2021, 7:40 PM
    Is there a recommended way to check out submodules in Seed?
    f
    • 2
    • 14
  • d

    Dmitry Pavluk

    03/18/2021, 8:03 PM
    @Dennis Dang has been working with me on migrating our API to SST. It's been a fun adventure, we're about to deploy the new setup to QA and UAT
    f
    d
    t
    • 4
    • 14
  • s

    Slackbot

    03/18/2021, 10:03 PM
    This message was deleted.
    f
    d
    • 3
    • 2
  • d

    Dmitry Pavluk

    03/19/2021, 3:18 AM
    Is there a simple way to silence these? Not sure how to effectively try/catch a downstream dep from
    node_modules
    Copy code
    > node_modules/formidable/lib/file.js:1:19: warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning)
        1 │ if (global.GENTLY) require = GENTLY.hijack(require);
    p
    f
    j
    • 4
    • 13
  • d

    Dennis Dang

    03/19/2021, 4:11 PM
    Does the SST have a recommended way to grant just one lambda permission to push to a topic? Given https://serverless-stack.com/examples/how-to-use-pub-sub-in-your-serverless-app.html as the example, we are granting the entire Api construct permission to push to the topic. A workaround is to pass in the topic arn only to that lambda's environments. But I'd like more reassurance and would like to stay in the SST garden before I use aws-cdk directly,
    f
    m
    d
    • 4
    • 13
  • d

    Dennis Dang

    03/23/2021, 12:57 AM
    I'd like to attach a usage plan to throttle per stage/routes/etc. CDK allows me to create plans like so
    const usagePlan = new apigateway.UsagePlan(scope, id, { name:  "PoorDevPlan",throttle: { rateLimit: 5000 } });
    . But how can I attach this to the current Api construct?
    f
    d
    • 3
    • 18
  • f

    Frank

    03/23/2021, 4:12 AM
    👀 Anyone using AppSync here? • Do you have 1 Lambda per query? Or 1 Lambda handling a bunch of queries? • Are you using all Lambda resolvers, or a mix of DynamoDB/RDS and Lambda resolvers? Trying to create an
    sst.AppSync
    construct, and I’m curious if ppl have a lot of resolvers and if there’s an easier way to define them, ie. something like the Api routes make sense?
    Copy code
    resolvers: {
      'query listNotes' : 'src/listNotes.main',
      'query getNote'   : 'src/getNote.main',
      'mutation addNote': 'src/addNote.main',
    }
    p
    m
    +2
    • 5
    • 5
  • d

    Dmitry Pavluk

    03/24/2021, 1:34 AM
    Is there a way to deploy the http api into a custom VPC? E.g. not a default one? Update: API GW has no VPC, duh
    f
    • 2
    • 8
  • d

    Dmitry Pavluk

    03/26/2021, 4:11 AM
    Realized I've accumulated a collection of little scripts to help patch up things that CDK and/or SST don't easily provide, might be useful to others:
    Copy code
    # API GW: Set up throttling and metrics
    aws apigatewayv2 update-stage \
        --api-id xxx \
        --stage-name '$default' \
        --default-route-settings '{"ThrottlingBurstLimit":10,"ThrottlingRateLimit":50,"DetailedMetricsEnabled":true}'
    
    
    # CFN: fix stupidity. See <https://github.com/serverless-stack/serverless-stack/issues/125>
    aws logs put-resource-policy --policy-name AWSLogDeliveryWrite20150319 --policy-document "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AWSLogDeliveryWrite\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"<http://delivery.logs.amazonaws.com|delivery.logs.amazonaws.com>\"},\"Action\":[\"logs:CreateLogStream\",\"logs:PutLogEvents\"],\"Resource\":[\"*\"]}]}"
    
    
    # Aurora: enable Performance Insights on every instance. If needed: brew install jq
    aws rds describe-db-instances --query 'DBInstances[*].[DBInstanceIdentifier]' \
            | jq -r '.[]' | jq -r '.[]' \
            | xargs -J % -L1 \
            aws rds modify-db-instance \
                --db-instance-identifier % \
                --enable-performance-insights
    f
    d
    r
    • 4
    • 10
  • m

    Matthew Purdon

    03/26/2021, 2:41 PM
    I was looking in the docs but I don’t see steps for running sst in an AWS code pipeline. There are some things to address such as sst build outputting to .build/cdk.out but the deploy stage looks for basepath ./cdk.out for example. Is there a good resource for this? Maybe I am messing something up?
    f
    • 2
    • 17
  • b

    Bma

    03/27/2021, 1:55 PM
    Hello guys! Question! How can I reference one stack in another stack? In your example, you create DynamoDB Stack + the API in the same file. But what if I want to create a separate file, one for DynamoDB and one for the API, then allow the API to access the DynamoDB(my table) in my API file.
    d
    f
    • 3
    • 6
  • t

    thdxr

    03/27/2021, 9:56 PM
    maybe some kind of buffer when reading from the spawned node proc or max websocket frame size?
    j
    f
    • 3
    • 10
  • t

    Tyler Flint

    03/29/2021, 9:51 PM
    I’m wondering about initially just migrating the functions and then when I have more time think through an eventual full-migration strategy.
    f
    p
    • 3
    • 17
  • p

    Pål Brattberg

    03/29/2021, 10:42 PM
    When using the
    Api
    construct, do we not get automatic `LogGroup`s for our functions/routes? Only the access logs? I can't find logging output from my functions anywhere, but guessing I'm just too tired? 🤪
    f
    t
    • 3
    • 13
  • m

    Matthew Purdon

    03/30/2021, 1:21 PM
    Out of curiosity, why does sst.Stack’s constructor require an sst.App instead of a construct? It’s a problem in the cdkPipeline because it gets called within the scope of a stage not an sst.App. I guess you’d have to implement an sst Stage type that implements the interface of sst.App to get around it? I guess that’s what the work in https://github.com/serverless-stack/serverless-stack/discussions/279 would involve?
    f
    s
    • 3
    • 49
12345...33Latest