https://serverless-stack.com/ logo
Join Slack
Powered by
# help
  • j

    João Pedro

    09/28/2021, 7:28 PM
    hello folks by creating a new project using
    npx create-serverless-stack@latest --language typescript
    it’s giving me the following error when installing the packages:
    Copy code
    npm ERR! code 1
    npm ERR! path /Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/aws-crt
    npm ERR! command failed
    npm ERR! command sh -c node ./scripts/install.js
    npm ERR! info TOOL Using Unix Makefiles generator.
    npm ERR! info TOOL Building only the install target, as specified from the command line.
    npm ERR! ERR! OMG CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: <http://cmake.org>.
    npm ERR! /Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/cMake.js:115
    npm ERR!         throw new Error("CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: <http://cmake.org>.");
    npm ERR!               ^
    npm ERR! 
    npm ERR! Error: CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: <http://cmake.org>.
    npm ERR!     at CMake.verifyIfAvailable (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/cMake.js:115:15)
    npm ERR!     at CMake.build (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/cMake.js:287:10)
    npm ERR!     at BuildSystem._invokeCMake (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/buildSystem.js:59:40)
    npm ERR!     at async buildFromRemoteSource (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/aws-crt/scripts/build.js:148:5)
    f
    • 2
    • 12
  • s

    Sam Hulick

    09/29/2021, 2:42 AM
    I found a weird instance of my global log retention setting being disregarded for some reason in my
    main()
    , I have this:
    Copy code
    app.setDefaultFunctionProps(stack => ({
        // ...
        logRetention:
          app.stage === 'prod'
            ? logs.RetentionDays.THREE_MONTHS
            : logs.RetentionDays.FIVE_DAYS,
    and yet, this one slipped through the cracks
    f
    j
    • 3
    • 15
  • j

    Joe Kendal

    09/29/2021, 7:21 AM
    Does anyone else run into “Cannot find a handler file for” when using Jest and
    new sst.Function
    ? https://github.com/serverless-stack/serverless-stack/issues/868
    t
    • 2
    • 3
  • i

    Isaac P

    09/29/2021, 7:56 PM
    relatively new to SST - what happens if I have already defined a stack with some dynamodb tables, and i update the stack to add more tables. does it only add the new ones and leave everything else untouched? I don’t quite have the mental model down yet
    t
    • 2
    • 4
  • j

    João Pedro

    09/29/2021, 8:21 PM
    hello folks! Is there any way to hook into the watching system when running lambdas locally, like to regenerate stuff on tsoa? @Frank
    t
    • 2
    • 5
  • ö

    Ömer Toraman

    09/29/2021, 10:04 PM
    Hello there, I’m trying to use the aws cli’s auto-prompt mode ( https://github.com/aws/aws-cli/issues/5664 ) However, the mode quits after executing a single command. I enabled the mode by running 
    aws configure set cli_auto_prompt on
    f
    • 2
    • 3
  • d

    Dan Coates

    09/30/2021, 4:01 AM
    Hi there, I'm keen to try out serverless stack, just wondering what the best approach is when you have multiple packages in a monorepo. For example we often have a setup where we have multiple apis in the same monorepo and they have their own sets of dependencies, the structure might look like:
    Copy code
    - packages
    	- api1
    		- src
    			- index.ts
    		- package.json
    		- node_modules
    	- api2
    		- src
    			- index.ts
    		- package.json
    		- node_modules
    would you have a single install of serverless stack at the root? Or a separate one in each package? Is there an example of working with a monorepo like this?
    t
    o
    • 3
    • 6
  • a

    Adrián Mouly

    09/30/2021, 4:47 AM
    Hey guys, I have a mono-repo with 2 different react apps, and I’m using Lerna + Yarn. The thing is, apparently my dependencies are conflicting each other… One of my apps uses React 16 and the other React 17. The newer app, using 17, builds correctly, but on the browser I’m getting errors and the page not loading. Once I delete the other old-app, it works fine. So somehow my apps are conflicting each other, I thought YARN would handle different packages versions itselft. Anybody facing same config?
    s
    • 2
    • 12
  • a

    Aram

    09/30/2021, 6:50 AM
    Hey folks, is there a way to create custom resources through sst rather then using cfn-resource directly?
    s
    • 2
    • 2
  • d

    Dan Van Brunt

    09/30/2021, 1:07 PM
    Anyone have a cool method to trigger
    Cron
    functions manually during testing. a) Set the frequency very often in dev…. seems a bit too much, manual would be best b) Keep the AWS console open and keep clicking the run test button …. too many clicks c) write a short bash script to trigger the function with some dummy data…. I’m lazy, this would be great if there was a feature in SST to trigger on some kinda keyboard shortcut, like “on save” would be great!
    t
    i
    • 3
    • 7
  • d

    Dan Van Brunt

    09/30/2021, 1:11 PM
    Just gonna put this here again. We’re REALLY ❤️ ’n SST. Like a lot. It’s making so much of the process so much more enjoyable. The biggest benefit is how attentive the core team is with feedback and feature requests. The biggest challenge is how coupled it is with a specific CDK version. This is less of an issue the faster the team is able to keep them in sync.
    j
    • 2
    • 1
  • f

    Fazi

    09/30/2021, 3:30 PM
    Hi all, I have a couple of api routes defined as follows:
    Copy code
    const api = new Api(this, "Api", {
        routes: {
            "GET /skills": skillsSyncFunction
        },
    });
    I want to secure these so that the client needs a bearer token before making a request. My access token has the following fields:
    { 'AccessToken': 'eyJ...', 'ExpiresIn': 300, 'TokenType': 'Bearer', 'IdToken': 'eyJ...' }
    What would be the correct way to set up auth? I tried this but it failed:
    Copy code
    const api = new Api(this, "Api", {
        defaultAuthorizationType: ApiAuthorizationType.JWT,
        defaultAuthorizer: new HttpUserPoolAuthorizer({
            'userPool': env['AWS_USER_POOL'],
            'userPoolClient': env['AWS_CLIENT_ID']
        }),
        routes: {
            "GET /skills": skillsSyncFunction
        },
    });
    However this threw an error message:
    Copy code
    ApiUserPoolAuthorizer6F4D9292 Caught exception when connecting to <https://cognito-idp.eu-west-2.amazonaws.com/undefined/.well-known/openid-configuration> for issuer <https://cognito-idp.eu-west-2.amazonaws.com/undefined>. Please try again later. Error: Invalid issuer: <https://cognito-idp.eu-west-2.amazonaws.com/undefined>. Issuer must have a valid discovery endpoint ended with '/.well-known/openid-configuration' (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: 0000; Proxy: null)
    Could someone please guide me on how I could get auth working with API endpoints? Rest seems to all work very well
    g
    • 2
    • 3
  • a

    Abdul Taleb

    09/30/2021, 4:39 PM
    I just migrated our stack to a new AWS account and it's been waiting on a status update for 2+ hours. Any idea why? My cloudformation is still running
    t
    • 2
    • 9
  • a

    Abdul Taleb

    09/30/2021, 7:07 PM
    Another question, I'm moving AWS environments and I did a deployment in CI, however it didn't pickup changes to any of the websites and did not deploy, how can a force a deployment even if there is no diff? I'm using Yarn workspaces/Lerna btw
    t
    • 2
    • 3
  • j

    Jonathan Chapman

    09/30/2021, 11:18 PM
    Great project, I'm excited to get started using it. One quesiton, is there a way to point to a alternative
    tsconfig.json
    file? Currently, in my setup I have my file named as
    tsconfig.app.json
    and split the test file to
    tsconfig.spec.json
    .
    f
    t
    • 3
    • 14
  • a

    Aaron McCloud

    10/01/2021, 1:32 AM
    Hey, I was running
    npx sst start
    and had to cancel before it had run fully. Now when I attempt to run that command I get:
    Copy code
    Stack dev-newCenturyAPI-century-frontend is in the CREATE_IN_PROGRESS state. It cannot be deployed.
    f
    • 2
    • 8
  • h

    Hubert

    10/01/2021, 3:42 PM
    Hello! I've seem to have a problem with deployment. I've mainly been working with
    sst start
    for development, and today tried to deploy my application with
    sst deploy
    which seems to have hit a lambda limit.
    Copy code
    stack failed: Resource handler returned message: "Unzipped size must be smaller than 47358303 bytes (Service: Lambda, Status Code: 400, Request ID: e9aea816-1578-4523-9a68-2f16d3bb278c, Extended Request ID: null)" (RequestToken: 687bb199-2423-bcc6-df83-ffd2c4f44dce, HandlerErrorCode: InvalidRequest)
    I've got the exact same application deployed in SLS and the functions collectively do have a size larger than the limit, but when looking at them in their "stacks" or "microservices" they dont reach more than few MBs. Any suggestions on how to go about this? I've disabled bundling on few functions but I do have quite a few using Layers and the same layer may be used in multiple stacks - not sure if its an issue but I thought i will point it out. Thanks.
    f
    • 2
    • 15
  • a

    Anatol

    10/01/2021, 8:41 PM
    btw, I've deployed appsync service (this had the issue with custom domain plugin cause of
    sls package
    ), and I've used buildspec instead of post deploy phase like below:
    Copy code
    after_deploy:
      - if [ $SEED_SERVICE_NAME = "cognito" ]; then cd /tmp/seed/source/services/appsync && yarn && sls deploy; fi
    f
    • 2
    • 122
  • s

    Sam Hulick

    10/01/2021, 11:18 PM
    has anyone else been seeing this? is this an SST issue or an AWS issue?
    Copy code
    27e96e69-0234-4c15-99de-f4682c1063b6 REQUEST dev-microservices-api-files-getFolders [src/lambda/rest/functions/get-folders.main] invoked by API GET /folders
    27e96e69-0234-4c15-99de-f4682c1063b6 RESPONSE {"statusCode":400,"body":"{\"message\":\"SSL error: Remote host terminated the handshake\",\"code\":\"BadRequestException\",\"time\":\"20... 142 more characters"}
    t
    • 2
    • 3
  • d

    Devin

    10/02/2021, 10:18 PM
    in my
    ./frontend
    npm run test
    works just fine. When I run it the root, like Seed would in deploy, I get some babel errors. Do I need to configure the sst app to have the same config as the react app?
    a
    • 2
    • 4
  • n

    Noah D

    10/03/2021, 7:02 AM
    Hey currently having some issues with my SST local environment. When i launch the local environment I get an internal server error when i hit any endpoint (see second screenshot). I have looked at the cloudwatch logs (1st screenshot) and they don't tell me too much about the actual error itself unfortunately. It seems as well from the local console that I can't see it even logging the req/res as it would normally... I am able to do a deploy either via my command line or seed and the API's work fine so my suspicion is something is up with the local environment, but not sure what. Any assistance would be greatly appreciated 🙏
    f
    • 2
    • 6
  • m

    Mehmet Ali SARAÇ

    10/03/2021, 12:10 PM
    Hi, for websocket api authorizers there is wrong documentation I guess. I may did something wrong aswell. Can u please check I'm getting error AuthorizerResultTtlInSeconds cannot be set for WEBSOCKET protocol Apis. Documentation : https://docs.serverless-stack.com/constructs/WebSocketApi#adding-lambda-authorization
    Copy code
    this.wsAuthorizerFn = new sst.Function(this, "ws-authorizer", {
      handler: "src/services/messenger.wsAuthorizer",
    })
    
    
    this.messengerApi = new sst.WebSocketApi(this, "messenger-service", {
      accessLog: false,
      authorizationType: sst.WebSocketApiAuthorizationType.CUSTOM,
      authorizer: new HttpLambdaAuthorizer({
        authorizerName: `LambdaAuthorizer`,
        handler: this.wsAuthorizerFn
      }),
      routes: {
        $connect: {
          handler: "src/services/messenger.onWebsocketConnected",
          environment: {
            WEBSOCKET_CONNECTION_TABLE: this.connectionTable.tableName
          }
        },
        $disconnect: {
          handler: "src/services/messenger.onWebsocketDisconnected",
          environment: {
            WEBSOCKET_CONNECTION_TABLE: this.connectionTable.tableName
          }
        },
      }
    })
    failed: AuthorizerResultTtlInSeconds cannot be set for WEBSOCKET protocol Apis. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: d46f8a9a-e138-4a00-8b9e-fc60c36e9da9; Proxy: null)
    f
    h
    • 3
    • 11
  • s

    Sam Hulick

    10/03/2021, 9:05 PM
    is the
    yarn start
    process single-threaded? I noticed that if it’s running and I get a bunch of webhooks at once from my billing provider, it runs the webhook handler function one at a time
    t
    f
    • 3
    • 5
  • f

    Fabian Ehringer

    10/04/2021, 2:23 PM
    hey guys 🙂 what’s the best practice for bigger projects. Do you recommend splitting the SST app into multiple smaller apps? Running
    yarn start
    takes a long time for us even if there are no changes. Is there a way to only debug stacks where you’re currently working on with
    yarn start
    and just have the rest of the stacks deployed or something like that?
    t
    f
    • 3
    • 21
  • s

    solsglasses

    10/04/2021, 4:27 PM
    I use Serverless Framework with https://seed.run every chance I get (haven’t tried SST yet), but sometimes using Docker is unavoidable. Is anyone aware of a tool that managed AWS ECS Fargate, similar to how sls manages Lambda? I want to avoid using Terraform if possible. In other words, solve for ❌
    AWS Lambda : Serverless Framework == AWS ECS : ❌
    t
    f
    • 3
    • 23
  • k

    Kelly Davis

    10/04/2021, 7:32 PM
    We periodically get an error like this when deleting a stack where the resource type is `Custom::SSTBucketDeployment`:
    Copy code
    CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [...]. 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.
    This is associated with an
    sst.ReactStaticSite
    - any ideas what might be causing this and how to mitigate it?
    f
    • 2
    • 4
  • t

    thdxr

    10/04/2021, 10:57 PM
    Has anyone used the experimental lambda edge function? Getting some vague immediate errors
    f
    a
    • 3
    • 35
  • d

    Dan Van Brunt

    10/05/2021, 1:01 PM
    Just used
    npx sst add-cdk
    when I had a bunch of packages set to
    1.124.0
    and it installed a bunch at
    1.125.0
    1. Just realized I don’t know a way to check with CDK version SST’s version is at short of hunting down SST’s package.json 2. Should a tool like
    npx sst add-cdk
    not take into account version mismatches between what you might have installed vs CDK latest vs SST latest and let you know of any anomalies?
    t
    • 2
    • 4
  • l

    Lukasz K

    10/05/2021, 1:11 PM
    Anyone else working on MacOs and having fsevents issue (_No loader is configured for ".node" files: node_modules/fsevents/fsevents.node_) when building lambas after update to Big Sur v11.6? I remember resolving it one way or another last time but it was ages ago...
    d
    r
    m
    • 4
    • 5
  • d

    Dan Van Brunt

    10/05/2021, 2:08 PM
    Is there a way to explicitly set the PolicyStatement in the
    permissions
    prop for a function?
    Copy code
    permissions: [
      [eventsBucket, 'headObject', 'getObject'],
      [
        new iam.PolicyStatement({
          actions: ['ssm:*'],
          effect: iam.Effect.ALLOW,
          resources: [`arn:aws:ssm:${REGION}:${ACCOUNT_ID}:parameter${SSM_HUBSPOTAPIKEY}`],
        }),
      ],
    ],
    …this does not work. in this case, do we have to use…
    Copy code
    fun.attachPermissions([
     new iam.PolicyStatement({
       actions: ["execute-api:Invoke"],
       effect: iam.Effect.ALLOW,
       resources: [
         `arn:aws:execute-api:${region}:${account}:${api.httpApiId}/*`,
       ],
     }),
    ]);
    t
    • 2
    • 16
1...202122...83Latest