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

    Alexis Levasseur

    03/31/2022, 2:06 PM
    Hi everyone, I'm trying to make CORS work on my API. I have enabled cors on it and all the routes use AWS_IAM authorization.
    Copy code
    cors: true,
    defaultAuthorizationType: ApiAuthorizationType.AWS_IAM,
    The problem is that I need to add a route that calls into a lambda in order to handle the preflight calls.
    Copy code
    'OPTIONS /{proxy+}': {
              function: 'src/functions/api/options.main',
              authorizationType: ApiAuthorizationType.NONE,
            },
    The lambda simply returns the proper headers:
    Copy code
    return {
        statusCode: 204,
        body: '',
        headers: {
          'Access-Control-Allow-Origin': '*',
          'Access-Control-Allow-Methods': '*',
          'Access-Control-Allow-Headers': '*',
        },
      };
    It does work, but I hate the fact that I need to manage my own lambda to do CORS. Anyone here got it working without having to go through all this? I suppose there is a way to add a route to the sst.API without specifying an integration right? (I can do that using the console) Any help would be greatly appreciated.
    d
    • 2
    • 26
  • d

    Dan Van Brunt

    03/31/2022, 2:14 PM
    : Error: Cannot find module 'chrome-aws-lambda'\nRequire stack: /Users/me/Projects/idx/.sst/artifacts/klick-packages
    Getting this when trying to
    sst start
    from a SST app that imports a
    yarn linked
    construct that in-turn implements a lambda that “should” be implementing a layer with ``chrome-aws-lambda` in it. Any ideas how to fix so I can test this function? Does
    sst.Function
    implement layers when using
    sst start
    ?
    t
    • 2
    • 34
  • j

    Jacoby

    03/31/2022, 2:22 PM
    Hello friends, i think i've found an issue with
    eslint-config-serverless-stack
    while upgrading sst from
    0.60.4
    to
    0.69.3
    . 🐛 There seems to be a dependency mismatch in
    eslint-config-serverless-stack
    . Basically, specified versions for
    @typescript-eslint/eslint-plugin
    and
    @typescript-eslint/parser
    specify a different
    eslint
    peer dependency. Take a look at the error when I try to install inside
    eslint-config-serverless-stack
    :
    Copy code
    user@DESKTOP-FEN9EV4 ~/Documents/serverless-stack/packages/eslint-config-serverless-stack (master)
    λ npm i
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: eslint-config-serverless-stack@0.69.3
    npm ERR! Found: eslint@8.12.0
    npm ERR! node_modules/eslint
    npm ERR!   eslint@"^8.10.0" from the root project
    npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/eslint-plugin@5.17.0
    npm ERR!   node_modules/@typescript-eslint/eslint-plugin
    npm ERR!     @typescript-eslint/eslint-plugin@"^5.12.1" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from @typescript-eslint/parser@4.33.0
    npm ERR! node_modules/@typescript-eslint/parser
    npm ERR!   @typescript-eslint/parser@"^4.15.1" from the root project
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR!
    npm ERR! See C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2022-03-31T14_12_11_758Z-debug.log
    I get the same error when I try to install stuff in my own project after upgrading sst versions. Im not the wisest guy when it comes to npm, but it just looks like the parser's version should be updated to match eslint-plugin's. Let me know what you think 🤔
    t
    d
    f
    • 4
    • 24
  • o

    Omi Chowdhury

    03/31/2022, 10:26 PM
    Anyone have any opinions on code coverage tools? I’ve heard of code climate and codecov. Any other options I should consider?
    a
    r
    t
    • 4
    • 4
  • t

    Thomas Ankcorn

    04/01/2022, 8:49 AM
    Hey anyone else ran into any issues when using jest.setSystemTime(); in combination with the aws dynamodb client. For some reason it makes my tests start to timeout
    f
    • 2
    • 2
  • k

    Karolis Stulgys

    04/01/2022, 11:31 AM
    Can I deploy i.e
    nestjs
    app to
    aws
    using
    serverless stack cli
    ?
    t
    • 2
    • 22
  • a

    Adrian Schweizer

    04/01/2022, 2:32 PM
    how do you guys have CORS configured to only allow your prod URL and local dev environment? Adding "localhost" to the config doesn't seem to work.
    k
    f
    • 3
    • 20
  • s

    Seth Geoghegan

    04/01/2022, 4:22 PM
    Does SST.EventBus support APIDestinations? The CDK EventBridge construct library supports
    ApiDestination
    , so I think it's supported by CDK
    t
    f
    • 3
    • 11
  • k

    Karolis Stulgys

    04/01/2022, 9:37 PM
    Hi, whats happening? I develop my lambda with
    npx sst start
    everything works fine with the endpoint. Then I
    npx sst deploy --stage prod
    and I get an error on the frontend:
    d
    k
    • 3
    • 26
  • k

    Karolis Stulgys

    04/02/2022, 8:13 AM
    Does anyone can help me with the issue I described above?
    c
    r
    • 3
    • 5
  • k

    Karolis Stulgys

    04/02/2022, 2:27 PM
    npx sst start
    f
    • 2
    • 2
  • u

    Uday Bhaskar Gajavalli

    04/02/2022, 2:54 PM
    Unable to load SST Console in Brave Browser
    t
    f
    • 3
    • 7
  • k

    Karolis Stulgys

    04/03/2022, 12:05 AM
    If I have lambda that scrapes web and it's execution can take 10 -20s it's better to deploy server on EC2 (never did that) or fly.io instead of deploying just lambda. Am I right?
    m
    r
    d
    • 4
    • 10
  • b

    Brinsley

    04/04/2022, 11:14 AM
    Super weird one today guys, getting the error:
    Copy code
    ❌  <stack-name> failed: The <stack-name> stack contains no resources.
    Despite the stack creation completing successfully. Doesn't look to be any actual errors thought.
    t
    f
    • 3
    • 9
  • d

    David Tsai

    04/04/2022, 4:20 PM
    Hello all, I'm new to SST and am looking to utilize it to deploy a Next.js app using
    NextjsSite
    plugin. However, my app utilizes RDS as its datastore behind a VPC and as far as I can tell it's not possible for Lambda@EDGE to connect to RDS behind a VPC. Is this true? If so, is there another recommended way I could deploy my app securely?
    t
    • 2
    • 11
  • w

    Wes Morgan

    04/04/2022, 4:20 PM
    Hey all, current SAM user here. Ran across SST recently and it sounds great. However I use a custom lambda runtime and I'm wondering how well / if SST works with those. Didn't see anything in the docs / FAQ, so hoping someone knows the answer here. Thanks!
    t
    • 2
    • 6
  • t

    Tim V

    04/04/2022, 6:23 PM
    Heya! Can we set log retention policies on the debug stack? I'm not seeing a way, but maybe I'm missing something. I'm just trying to get rid of all the "never expire" logs. Thanks!!
    f
    • 2
    • 13
  • m

    Mischa Spiegelmock

    04/04/2022, 7:31 PM
    how do I replace my dynamo table (i don't mind losing data)
    Copy code
    mish-sequencer-DynamoTable | UPDATE_FAILED | AWS::DynamoDB::Table | AppTableA64782C6 | CloudFormation cannot update a stack when a custom-named resource requires replacing. Rename mish-sequencer-AppTable and update the stack again.
    t
    f
    • 3
    • 13
  • k

    Karolis Stulgys

    04/05/2022, 8:39 AM
    How do I write
    github action
    that
    on marge
    to
    main
    branch, deploys my stack?
    m
    b
    m
    • 4
    • 8
  • s

    Seth Geoghegan

    04/05/2022, 1:41 PM
    It looks like the
    sst.TableFieldType.STRING
    went away at some point?
    Copy code
    Property 'TableFieldType' does not exist on type 'typeof import("/Users/sgeoghegan/dev/dynamodb-eventbridge/node_modules/@serverless-stack/resources/dist/index")'.ts(2339)
    t
    • 2
    • 7
  • c

    Cody Dunlap

    04/05/2022, 1:45 PM
    I have a stack built that includes only a
    Table
    construct for DynamoDB. When I build and deploy the stack, the resources get created as expected in my AWS account, but SST reports that the deploy failed because my stack ‘has no resources in it’. Any idea what could be causing this?
    f
    b
    • 3
    • 5
  • m

    Meris Tarhanis

    04/05/2022, 2:01 PM
    Hello people, How do I avoid this being displayed instead of my React Site when I click on SiteUrl: while I am doing
    npx sst start --stage dev
    . Just to be clear, I want my React Frontend to be available on the SiteUrl: while I am running the
    sst start
    locally.
    t
    f
    • 3
    • 10
  • d

    David Garcia

    04/05/2022, 2:30 PM
    is it possible to bypass sst's custom stack name string manipulation and use a non-prepended string to guide which stack to deploy in a multi-stack process?
    t
    f
    • 3
    • 10
  • k

    Kujtim Hoxha

    04/05/2022, 3:34 PM
    Did any of you guys have this issue before 😅
    Template may not exceed 1000000 bytes in size.
    f
    t
    +3
    • 6
    • 13
  • r

    Rafael Sorto

    04/05/2022, 5:44 PM
    Hello everyone good day! I just have a quick question, do you guys know how to run post build commands on a NextjsSite added to SST ? I normally create a sitemap after the build is done but postbuild doesn't seem to trigger when I'm deploying my site via SST 😞
    f
    j
    • 3
    • 15
  • d

    Dan Van Brunt

    04/05/2022, 7:12 PM
    Does SST
    enableLiveDev
    work for
    Lambda@Edge
    functions? Just lamenting to a coworker that Edge functions while VERY powerful and useful, are a HUGE PINT to develop with.
    f
    • 2
    • 1
  • r

    Rob N

    04/05/2022, 9:18 PM
    Hey has anyone seen this issue before. running
    npx sst start
    in my monorepo is just streaming
    Stacks: Synthesizing changes...
    forever. Anyone know what would cause this?
    f
    o
    • 3
    • 30
  • m

    Meris Tarhanis

    04/06/2022, 10:07 AM
    Hello everyone, I am getting
    Status Code 403
    while trying to access my API (with AWS_IAM authorization on the endpoint) from the frontend. Might someone know why it's happening? Down below are logs from CloudWatch, my lambda handler, and the endpoint inside my API Stack. Will provide more info if needed.
    f
    • 2
    • 1
  • e

    Erik Robertson

    04/06/2022, 10:24 AM
    In my defaultFunctionProps for all my routes I have the following in order for things to work properly with sequelize and mysql :
    Copy code
    bundle: {
              externalModules: ['pg-hstore'],
              nodeModules: ['mysql2']
            },
    Now my question is how do I do the equivalent for a cron job definition ? I tried this without success :
    Copy code
    new Cron(this, "Cleanup", {
          schedule: "cron(0 9 * * ? *)", 
          job: "src/jobs/cleanup.main",
          enableLiveDev: false,
          bundle: {
            externalModules: ['pg-hstore'],
            nodeModules: ['mysql2']
          },
        });
    Also is there any way to set this in a "global" way so that I don't have to repeat it everywhere ? Thanks !
    b
    • 2
    • 4
  • k

    Karolis Stulgys

    04/06/2022, 2:16 PM
    How do I setup my sst nextjs app domain? I.e I have domain from hostinger
    f
    • 2
    • 1
1...626364...83Latest