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

    Arpad

    05/27/2022, 7:43 AM
    Hey everyone! Wondering if there has been any discussion about adding URL rewrite/proxy in the static site resources. I know we can do this manually by adding a function to the cloudfront distribution to proxy requests from
    <http://example.com/api|example.com/api>
    to
    <http://my-api-domain.com/|my-api-domain.com/>
    but I'm wondering if there's any plan on adding this to the current static site resources to automate it a bit.
    f
    • 2
    • 5
  • l

    Louis Holley

    05/27/2022, 10:07 AM
    @thdxr just catching up with the stream from yesterday! around 39 mins you discuss next not really being suitable for the ideal stack esque setup. we use next for all our frontend projects without using SSR at all and sometimes even without next's API routes - it's great out of the box even without those main selling points, and we love the DX. letting you know that it might be worth considering the use case of using this stack with next because that's what we'll be doing!

    this video▾

    might be informative
    g
    t
    • 3
    • 4
  • m

    Michael Robellard

    05/27/2022, 3:08 PM
    Here's an SST design question, why does SST need to create a new IAM role for each Lambda function even though the roles each appear different? Clearly you need one for each stage and region as the resources will be different in those cases, but for each Lambda function of which I have many SST is creating an identical Role. Obviously if you have customized resources for each Lambda they need different roles, but in my case they all have the same IAM requirements.
    t
    f
    • 3
    • 7
  • a

    arda

    05/28/2022, 8:41 PM
    I wonder if the doc for Bucket has been outdated: https://docs.serverless-stack.com/constructs/v0/Bucket#enabling-s3-event-notifications. It seems some of the properties are no longer available.
    t
    • 2
    • 4
  • g

    Gabriel

    05/30/2022, 10:59 AM
    Hi, I wanted to suggest to consider doing versioned docs. Since in cases like upgrading from v0.69 to v1.0 it would be nice if we could just change the version on docs and see what is the new way and old way for doing the same thing. (I know there is a migration guide, but I think this doc version feature is a nice thing) an example: https://typesense.org/docs/0.22.2/api/
    f
    • 2
    • 2
  • p

    Paul Swail

    05/30/2022, 3:25 PM
    Do you have any articles/guides in the SST docs around what logic to apply for splitting a single app/service into multiple stacks (which are all deployed together)? To be clear, I’m not talking about splitting into multiple (micro)services here, but rather what things a developer should consider when deciding how to group different resources in multiple stacks. For example, I notice in @thdxr’s IdealStackPreview that the stacks are super-granular–just one resource per stack for many of them.
    t
    • 2
    • 14
  • j

    John Kor

    05/30/2022, 8:59 PM
    does anyone have any resources or guide i can look at in regards to using SST with nestjs? im trying to create a very simple lambda handler that fetches a service from the nestjs DI container and calls a simple method and i get the following error:
    Copy code
    john@pop-os:~/Development/edvisor-io/pricing-lambda$ yarn sst build
    yarn run v1.22.15
    $ /home/john/Development/edvisor-io/pricing-lambda/node_modules/.bin/sst build
    Using stage: john
    Preparing your SST app
    Synthesizing CDK
    
    Error: There was a problem transpiling the Lambda handler: ✘ [ERROR] Could not resolve "@nestjs/websockets/socket-module"
    
        node_modules/@nestjs/core/nest-application.js:18:115:
          18 │ ...ocket-module', () => require('@nestjs/websockets/socket-module'));
             ╵                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
      You can mark the path "@nestjs/websockets/socket-module" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.
    .. along with other errors regarding other modules (ie.
    class-transformer
    ,
    class-validator
    , etc..)
    t
    h
    • 3
    • 12
  • d

    Dan Suceava

    05/30/2022, 9:44 PM
    I recently upgraded to 1.0.2, then to 1.2.11, and I started getting these errors randomly while deploying:
    fail: One or more of the specified parts could not be found.  The part may not have been uploaded, or the specified entity tag may not match the part's entity tag.
    ... I'll get the errors once, then re-deploy and no errors, then next time this error again ... I've tried downgrading back to 1.0.2 and still getting them, so not sure what's causing these ... I'm not even sure it's related to the upgrade. Has anyone seen these?
    t
    f
    • 3
    • 17
  • d

    Daniel Gato

    05/31/2022, 8:52 AM
    Upgrading to 1.x will change the name of the stack. My stack went from
    daniel-mbp-sayduck-viewer
    to
    daniel-mbp-sayduck-ViewerStack
    Anyway to avoid this?
    Passing the id while adding the stack works
    o
    • 2
    • 1
  • s

    Scott

    06/01/2022, 1:19 AM
    Hi, I'm trying to deploy to a new account + environment since updating to the latest version of sst but I'm running into problems with my frontend & database where they get stuck on custom SST resources for about an hour before rolling back as they were unable to proceed. I've detailed the errors below, I may try rolling back to an earlier version of SST to see if that resolves the errors, but if anyone has any insights I'm all ears. Frontend stack fails on Custom::SSTEdgeLambdaBucket:
    Copy code
    CREATE_FAILED | Custom::SSTEdgeLambdaBucket | EdgeLambdaBucket | CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [43be6075-8550-4a85-91a3-e4227206f263]. If you are using the Python cfn-response module, 
    you may need to update your Lambda function code so that CloudFormation can attach the updated version.
    When looking into the cloud watch logs I find:
    Copy code
    undefined	ERROR	Uncaught Exception 	
    { "errorType": "Error", "errorMessage": "Must use import to load ES Module: /var/task/s3-bucket.js\nrequire() of ES modules is not supported.\nrequire() of /var/task/s3-bucket.js from /var/runtime/UserFunction.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.\nInstead rename s3-bucket.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/package.json.\n", "code": "ERR_REQUIRE_ESM", "stack": [ "Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /var/task/s3-bucket.js", "require() of ES modules is not supported.", "require() of /var/task/s3-bucket.js from /var/runtime/UserFunction.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.", "Instead rename s3-bucket.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/package.json.", "", " at Object.Module._extensions..js (internal/modules/cjs/loader.js:1015:13)", " at Module.load (internal/modules/cjs/loader.js:863:32)", " at Function.Module._load (internal/modules/cjs/loader.js:708:14)", " at Module.require (internal/modules/cjs/loader.js:887:19)", " at require (internal/modules/cjs/helpers.js:74:18)", " at _tryRequire (/var/runtime/UserFunction.js:75:12)", " at _loadUserApp (/var/runtime/UserFunction.js:95:12)", " 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:999:30)" ] }
    Backend stack fails on Custom::SSTScript:
    Copy code
    CREATE_FAILED | Custom::SSTScript | ClusterMigrationResource0F3A2EDD | CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [ad1c4d9e-6946-482e-bd9d-f18bb90f6610]. If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version
    When looking into the cloud watch logs I find:
    Copy code
    ERROR	Invoke Error 	{"errorType":"SyntaxError","errorMessage":"Unexpected token 'export'","stack":["/var/task/sst_rds_migration_scripts/0001_setupAuthTables.js:1","export const up = async (db) => {","^^^^^^","","SyntaxError: Unexpected token 'export'","    at Object.compileFunction (node:vm:352:18)","    at wrapSafe (node:internal/modules/cjs/loader:1032:15)","    at Module._compile (node:internal/modules/cjs/loader:1067:27)","    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)","    at Module.load (node:internal/modules/cjs/loader:981:32)","    at Function.Module._load (node:internal/modules/cjs/loader:822:12)","    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:161:29)","    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)","    at async Promise.all (index 0)","    at async ESMLoader.import (node:internal/modules/esm/loader:337:24)"]}
    f
    • 2
    • 2
  • k

    Kiran Siddagangappa

    06/01/2022, 7:16 AM
    Hi @Frank , Thank you to the entire sst team for making it easy to work with serverless apps. Here is my query, can we have reusable artifact in the context of CICD separate build and deploy pipelines. For example, the serverless framework has support of using the same build for deploying without rebuilding by referencing the path to the build and can be found in this blog. Is this something that the sst can support? I can see an open issue ,but our context is on separate build and deploy pipelines.
    f
    k
    • 3
    • 5
  • k

    Kevin Wright

    06/01/2022, 3:52 PM
    hi friends - SST Queue construct. i am setting up an SQS+lambda workflow. the lambda+sqs integration supports
    ReportBatchItemFailures
    responses from lambda. is this enabled with the integration that the Queue construct creates?
    f
    • 2
    • 6
  • a

    Austin

    06/01/2022, 4:23 PM
    Question: is it possible to create resources in multiple accounts as part of the same SST project? Context: We’re setting up some cross-account EventBridge architecture and would like consuming domain projects to be able to add EventBridge rules to a central event bus in another account without needing to manually do this in the console or in some other out-of-band project. So we basically need a single resource/construct in an SST project to be built in another account when deploying.
    e
    k
    +2
    • 5
    • 6
  • m

    Mischa Spiegelmock

    06/01/2022, 6:57 PM
    can you mix and match class-based and functional stacks?
    t
    • 2
    • 4
  • t

    Tiago Dall'Oca

    06/02/2022, 1:51 AM
    quick question: is there a way to run scripts before and after
    sst start
    ?
    t
    k
    m
    • 4
    • 19
  • g

    Gabriel

    06/02/2022, 10:14 AM
    hi, I think there is maybe an error in docs. https://docs.serverless-stack.com/constructs/v0/migration#access-log says
    Copy code
    retention: "two weeks"
    but this will throw an error, so it seems it has to be:
    Copy code
    retention: "two_weeks"
    (same is provided in https://github.com/serverless-stack/serverless-stack/blob/master/packages/resources/src/Api.ts#L245 )
    f
    • 2
    • 1
  • v

    Viswa

    06/02/2022, 9:28 PM
    Hi @Frank: thank you and the sst team for providing much better experience working with serverless apps. Feature Request: Looks like "sst build / sst deploy " does not have a way to enable or disable source maps. It'd be really helpful if there is a flag that can be toggled to disable/enable source maps when deploying lambda functions
    d
    f
    +3
    • 6
    • 14
  • b

    Boris Tane

    06/04/2022, 9:57 AM
    👋 hey team! I just ran
    npx create-serverless-stack my-app --language typescript
    and the package.json generated is for a previous version of sst. I'm not sure if this is still the recommended way to bootstrap a new sst app. if it's not anymore, it's still on the marketing website package.json:
    Copy code
    {
      "name": "my-app",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "test": "sst test",
        "start": "sst start",
        "build": "sst build",
        "deploy": "sst deploy",
        "remove": "sst remove"
      },
      "eslintConfig": {
        "extends": [
          "serverless-stack"
        ]
      },
      "devDependencies": {
        "@tsconfig/node14": "^1.0.1",
        "@types/aws-lambda": "^8.10.70",
        "@types/node": "<15.0.0",
        "typescript": "4.4.4",
        "@serverless-stack/cli": "0.69.7",
        "@serverless-stack/resources": "0.69.7",
        "aws-cdk-lib": "2.15.0"
      },
      "dependencies": {}
    }
    f
    s
    • 3
    • 5
  • j

    jamlen

    06/06/2022, 11:52 AM
    @thdxr @Frank bringing this error over from the Kysely discord, I’m trying to run my initial migration on a greenfield project, but Kysely is erroring with
    Error: invalid immediate value [object Object]
    and it sounds like it has got two different versions of Kysely somehow. This is using Postgres on Aurora.
    t
    • 2
    • 25
  • k

    Kevin Wright

    06/06/2022, 2:51 PM
    does the team plan on integrating step functions in any way within SST? such as a SST-based higher-level construct versus importing a raw CDK step function... i'd like to hear what the team has to say on the choreography vs orchestration aspect of micro services. also interested in seeing how the SST library might package together their higher-level constructs with step functions here's an article that i think is excellent. https://theburningmonk.com/2020/08/choreography-vs-orchestration-in-the-land-of-serverless/
    s
    f
    k
    • 4
    • 22
  • a

    Adrián Mouly

    06/06/2022, 7:31 PM
    Hey guys, not sure what I changed, but during migration to SST v1, have this issue:
    Copy code
    ReferenceError: __dirname is not defined in ES module scope
    This file is being treated as an ES module because it has a '.js' file extension and '/Users/amouly/Projects/yabble/yabble-serverless/.build/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    t
    r
    m
    • 4
    • 109
  • j

    Jarod Stewart

    06/06/2022, 8:11 PM
    Curious is it ok to use
    @serverless-stack-slack/web
    ?
    t
    s
    • 3
    • 14
  • g

    Geoffrey Dagley

    06/07/2022, 4:25 PM
    As much as I love the console (it is SO MUCH BETTER than clicking around the AWS console), I would prefer to have automated tests to verify and debug things. Is there a guide or thread that walks through how to get automated tests working that hit the deployed lambdas?
    t
    • 2
    • 1
  • g

    Giorgio

    06/07/2022, 6:05 PM
    Hi 👋 , how does one 'wait' on a stack before the other one executes? particularly for the case of waiting for the prior stack to finish storing variables in SSM before the other pulls them instead of it throwing 'SSM parameter not available in account'
    t
    d
    +2
    • 5
    • 18
  • a

    Adrián Mouly

    06/07/2022, 8:09 PM
    Is it possible to use SST Console pointing to a non-local stage? like
    dev
    ?
    f
    • 2
    • 14
  • a

    Adrián Mouly

    06/07/2022, 10:25 PM
    I did a migration to sst v1, but my authorizers are not working.
    t
    • 2
    • 12
  • a

    Adrián Mouly

    06/08/2022, 9:27 PM
    Hey guys, I’m using EventBridge connected to SQS, and I need to set
    message group id
    , but it doesn’t work. I have this config on my EB Rule:
    Copy code
    targets: {
              targetOne: {
                type: 'queue',
                queue: subsystemFinishedQueue,
                cdk: {
                  target: {
                    retryAttempts: 1,
                    messageGroupId: '$.detail.surveyQuestionId',
                  },
                },
              },
            },
    f
    • 2
    • 10
  • j

    jamlen

    06/09/2022, 1:41 PM
    With RDS, can we use the aurora serverless v2 and therefore PostreSQL 13.4?
    t
    • 2
    • 15
  • t

    Tim

    06/09/2022, 9:51 PM
    we debugged an issue today where the same lambda code was behaving differently when using
    sst start
    or
    sst deploy
    , which turned out to be because the local environment was running node 16 and the deployed lambda was using node 14. would it be possible to have sst warn/error when
    sst start
    is running with the wrong runtime version?
    f
    • 2
    • 1
  • a

    Adrián Mouly

    06/10/2022, 12:05 AM
    Hello! Somebody here using IAM Authorizers for API GW? We noticed some of our internal APIs are really slow, we think could be due the IAM layer.
    f
    • 2
    • 1
1...2930313233Latest