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

    justindra

    07/05/2021, 9:22 PM
    Is there a way to use a different way to name the functions generated from the APIs? It just gets a little bit hard to find them when trying to debug or just find their Cloudwatch logs. These are two different endpoints that are creating an almost identical function names
    Copy code
    GET /modules/{moduleId}
    GET /modules/{moduleId}/shuttles
    f
    • 2
    • 4
  • m

    Manoel Feliciano

    07/05/2021, 9:46 PM
    Hi guys, I am trying to create a discord bot using the discord.js library. Locally with
    sst start
    it works fine, but when I try to deploy it, it complains about an external module called ffmpeg-static. If I add this library to the externalModules property of the bundle, the deploy works, but my function does not work when I call the url, it complains about the following… (will put inside the thread). Does anybody have a clue of what might be happening? Thanks a lot in advance!
    f
    • 2
    • 32
  • b

    Branko Gvoka

    07/06/2021, 9:52 AM
    Prisma + sst question Hey guys, I’m trying to use
    @prisma/client
    with sst. When I run
    sst start
    I’m getting
    Copy code
    Transpiling Lambda code...
     > node_modules/@prisma/client/runtime/index.js:24726:23: error: Could not resolve "_http_common" (mark it as external to exclude it from the bundle)
        24726 │   var common = require("_http_common");
              ╵                        ~~~~~~~~~~~~~~
    Did anyone encounter similar problem? I’ve tried to pull this into layer and used externalModules for @prisma/client but it also doesnt pick it up. Here’s Stack snippet in screenshot. I’ve even tried pulling these default into route directly but no luck. Thanks!
    t
    f
    • 3
    • 9
  • b

    Branko Gvoka

    07/06/2021, 9:58 AM
    Question 2 (Prisma + typecheck): For some reason, when
    typecheck: true
    is set, I’m getting type errors. I’ve tried to exclude node_modules in tsconfig but also no luck 🙂 Not my luckiest day.
    f
    j
    • 3
    • 18
  • m

    Michael Wolfenden

    07/07/2021, 2:29 AM
    Once you've constructed an
    api
    , is there anyway to retrieve the routes it was configured with?
    f
    • 2
    • 8
  • b

    Brinsley

    07/08/2021, 1:43 PM
    Possibly a super dumb question: got a lambda that is triggered from SQS. How do I test this with SST? Terminal logs an error if I try to test the lambda in the AWS Console:
    Copy code
    Get transspiler handler error TypeError: Cannot read property 'buildPromise' of undefined
    The lambda at the moment is just set up to log out the contents of the event and context so there’s nothing weird happening in there.
    f
    • 2
    • 6
  • m

    Mike McCall

    07/08/2021, 4:49 PM
    Running into an issue where sst start gets stuck on
    transpiling code…
    f
    • 2
    • 6
  • n

    Nick Laffey

    07/08/2021, 7:28 PM
    I’m trying to use the StateSite construct but I’m not understanding how to tell it to deploy to a subdomain on my hosted zone. I tried
    customDomain: "<http://mySubDomain.myDomain.com|mySubDomain.myDomain.com>"
    but it’s erroring out saying it can’t find the hosted zone:
    <http://mySubDomain.myDomain.com|mySubDomain.myDomain.com>
    f
    • 2
    • 7
  • a

    Adrián Mouly

    07/08/2021, 9:30 PM
    Hey guys, mi Lambdas are running out of memory, I’m sure doing something wrong, like printing too much logs or something wrong with mi DI framework… Now.. is there a way to do PROFILING of lambdas? ideally I want to run this in a CI/CD also, in a way that I can measure my lambda performance in an automated way.
    f
    • 2
    • 6
  • a

    Adrián Mouly

    07/09/2021, 3:50 AM
    Like I said before, my lambda is running out of memory… apparently I have a memory leak, once the function instance is UP (after a cold start) it starts to consume more and more memory. How is supposed that I can debug this kind of issues? that’s my problem with Lambda.. I don’t see an official way to debug or profile this. 😞 On this screenshot, you can see, from bottom to top, that my lambda starts to consume more and more memory on each request… after it reaches 512MB and crashes (that’s my limit).
    r
    j
    f
    • 4
    • 13
  • g

    Guy Shechter

    07/09/2021, 5:19 AM
    Question about the Api path mapping: AWS has supported multi-level base maps for the past few months, but when I try to construct an API with a custom domain with a multilevel
    path
    , it throws the following error:
    Copy code
    Error: An ApiMapping key may contain only letters, numbers and one of $-_.+!*'(),
        at new ApiMapping (app/node_modules/@aws-cdk/aws-apigatewayv2/lib/common/api-mapping.ts:69:13)
        at HttpStage._addDomainMapping (app/node_modules/@aws-cdk/aws-apigatewayv2/lib/common/base.ts:48:5)
        at new HttpStage (app/node_modules/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts:118:12)
        at new HttpApi (app/node_modules/@aws-cdk/aws-apigatewayv2/lib/http/api.ts:300:27)
        at new Api (app/node_modules/@serverless-stack/resources/src/Api.ts:178:22)
    This comment on aws-cdk seems to be related to v1 of the apigateway, but I’m not sure if v2 supports it in CDK yet.
    f
    • 2
    • 7
  • b

    Brett Gullan

    07/09/2021, 5:51 AM
    I'm using SST to create a StaticSite using Next.js. It worked the first couple of times I deployed. However, now I'm getting the following error:
    Copy code
    demo-scripts-now-client-StaticSite | CREATE_FAILED | Custom::SSTBucketDeployment | NextSiteCustomResourceAFBA8221 Received response status [FAILED] from custom resource. Message returned: [Errno 28] No space left on device (RequestId: 20d36fd2-65f7-4ecd-a4df-bcbde7a23bbd)
    Any ideas why this would be happening?
    f
    • 2
    • 21
  • h

    Hosy Mia

    07/10/2021, 3:04 PM
    Hi quick question, I am just getting started and have run the following commands listed in the docs •
    npx create-serverless-stack@latest my-sst-app --language python
    •
    npm run test
    I get the following error:
    Cannot find a handler file at src/lambda.js".
    Is it possible to change the default extension sst looks for to .py? instead of .js?
    j
    f
    • 3
    • 11
  • m

    Matt Stibbard

    07/11/2021, 9:59 AM
    Hi all, I'm getting the following on a new typescript starter - I'm confused which repo I should be raising an issue against though? Is ServerlessPlugin the main serverless-bundle?
    Copy code
    Serverless: Deprecation warning: CLI options definitions were upgraded with "type" property (which could be one of "string", "boolean", "multiple"). Below listed plugins do not predefine type for introduced options:
                 - ServerlessPlugin for "out"
                Please report this issue in plugin issue tracker.
                Starting with next major release, this will be communicated with a thrown error.
                More Info: <https://www.serverless.com/framework/docs/deprecations/#CLI_OPTIONS_SCHEMA>
    t
    j
    t
    • 4
    • 7
  • h

    Hosy Mia

    07/12/2021, 4:41 AM
    Hi, I was wondering what they best way to structure "common" functions without having to build a layer or an independent lib. In Serverless you could include the common folder, is there something similar in SST for python (I saw something for js)
    f
    • 2
    • 3
  • c

    Carlos Ribeiro

    07/12/2021, 8:55 AM
    Hey all ... need some help/guidance with bundling in sst please? Trying to bundle in some json files into my stack, but even with the bundle prop/option set in the main app it doesn't seem to bundle in the config folder... Any help or direction would be greatly appreciated!
    Copy code
    bundle: {
                copyFiles: [{
                    from: `src/config/`,
                    to: `src/config/`
                }] 
            }
    b
    t
    f
    • 4
    • 15
  • c

    colin

    07/12/2021, 7:15 PM
    Hey all - how have you all solved the multiple schema file problem with sst? I’ve looked into
    graphql-tools
    and also see there are a few experimental methods in the appsync sdk for creating fields, types, etc… but I was hoping to just do some sort of simple concatenation (without being too low level) and pass it into my AppSyncApi config.
    Copy code
    graphqlApi: {
      schema:  'src/schema/schema.graphql',
    }
    Any ideas here? Hoping to have a structure something like
    Copy code
    src/schema/
      -- project.schema
      -- other-entity.schema
    f
    a
    • 3
    • 21
  • g

    gligor

    07/13/2021, 9:27 PM
    Hi all, need some help with Seed deployment - I’m just updating all my stack dependencies and moving from serverless 1.x to 2.x - I have an overarching package.json that has serverless 2.x installed, but each stack is in a subfolder. I tried both, installing serverless in the overarching package and also in each individual stack, but Seed keeps using the old 1.x version to deploy my stack - not sure why
    f
    • 2
    • 11
  • l

    Louis Barclay

    07/14/2021, 10:59 PM
    I'm pretty confused here. When I run
    npx sst start
    and test a POST request with Postman, it works. When I stop running that, and test the POST request to the same URL, with the sst app deployed via
    npx sst start
    , I immediately get
    500 Internal Server Error
    , and no log appearing for the Lambda function in CloudWatch. I am certain that I'm sending the request to the correct URL. Any ideas of what I could be doing wrong? tl;dr: I'm getting
    500 Internal Server Error
    on all my functions and not sure why, and struggling to debug.
    f
    • 2
    • 21
  • g

    Guy Shechter

    07/16/2021, 4:33 AM
    Curious whether anyone has been able to create an S3 bucket with notification to SQS? When I try
    Copy code
    const incomingBucket = new s3.Bucket(this, 's3Incoming', {
          bucketName: `${scope.stage}-data-files`,
          removalPolicy: cdk.RemovalPolicy.DESTROY,
        });
        const incomingQueue = new sqs.Queue(this, 'sqsIncoming', {
          queueName: `${scope.stage}-incoming`
        });
        incomingBucket.addObjectCreatedNotification(incomingQueue);
    I get the following error:
    Copy code
    Error: ENOENT: no such file or directory, open 'app/.build/lib/lambda/index.py'
        at Object.openSync (node:fs:582:3)
        at Object.readFileSync (node:fs:450:35)
        at new NotificationsResourceHandler (app/node_modules/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts:87:29)
        at Function.singleton (pp/node_modules/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts:41:16)
        at BucketNotifications.createResourceOnce (app/node_modules/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts:105:52)
        at BucketNotifications.addNotification (app/node_modules/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts:54:27)
        at Bucket2.addEventNotification (app/node_modules/@aws-cdk/aws-s3/lib/bucket.ts:338:24)
        at Bucket2.addObjectCreatedNotification (app/node_modules/@aws-cdk/aws-s3/lib/bucket.ts:343:17)
        at new MyStack (app/lib/MyStack.js:26:20)
    It looks like CDK needs to create a lambda to connect the notification, but SST hasn’t added it to the build? I would do this directly with SST but it seems that Lambda functions are the only notification type supported from sst.Bucket.
    f
    • 2
    • 5
  • m

    Muhammad Ali

    07/16/2021, 2:19 PM
    Hey Everyone, I have a question, its more related to design of the system than any syntax/expcetion issue, so not sure if this is the right channel to post. If its not, then i apologize and please guide me to the correct one. I have an idea that i am trying to implement using SST. Its going to be a mobile app which has some features similar to any "Forums" i.e., there will threads and then reply with in those threads. Its a typical relational model but i am implementing it using DynamoDB. Which brings its own challenges. One of the challenge is to figure out if there are any "new" posts since last visit. For this i'd have to create some DynamoDB trigger to kick off a lambda and update a separate table tracking last post time in a thread. If it was relational db, i could have just easily done using a query. I am not choosing relational model because it would cost me ~$15-$23 per month and i am not sure how long i'd need to impelenet my backend and then future app. So my questions 1. Should i stay with dynamoDB. It may save the cost of relationaldb, but it would require me to create extra lambdas + dynamodb stream. 2. How can i manage (create/build etc) lambdas which are not associated to rest endpoint and are associated to something else (Sqs, dynamodb stream etc) using SST stack?
    r
    d
    j
    • 4
    • 3
  • m

    Mr.9715

    07/16/2021, 4:17 PM
    Hey guys, I am facing an issue when deploying/starting a new sst project.
    f
    • 2
    • 4
  • s

    Sean Brydon

    07/17/2021, 5:34 PM
    Hey - has anyone managed to get this setup with Postgres+Prisma ? This stack seems perfect for a project of mine however, I would ideally like to use prisma
    d
    f
    b
    • 4
    • 5
  • m

    Muhammad Ali

    07/19/2021, 3:53 PM
    Why didn't the tutorial created DynamoDB table using yaml file? With current approach if we ahve to replicate the stack in different regions, developer have to manually create the table. Thankfully in this case there is only one table but in real projects it could be more.
    j
    • 2
    • 5
  • b

    Branko Gvoka

    07/19/2021, 7:51 PM
    Anyone getting -
    Error: Do not directly set the environment for a stack?
    I’ve initialized empty project, added a stack, used AWS_PROFILE and --stage and I’m getting this somehow 🙂 I’ve added later empty environment in both BaseStack and service stack but didnt help
    f
    • 2
    • 7
  • w

    William Kasel

    07/19/2021, 9:41 PM
    Hi There, Thank you in advance for taking a look at this – I’m probably missing something very obvious, but what is the best pattern for adding / editing resources? Say for example we create a resource (say a dynamo table, or app sync api), and then modify. Does the CDK recognize that item already exists, or does it try to re-deploy it? The reason I ask is I’ve gotten this error:
    already exists in stack
    , and i’m 99% certain it’s just an incorrect workflow on my part. Any advice is helpful. For a more specific explanation, here is a demo:
    Copy code
    // Does CDK / SST recognize that this has already been deployed if I make a change or re-deploy? 
    
    const notesTable = new sst.Table(this, "Notes", {
          fields: {
            id: sst.TableFieldType.STRING,
          },
          primaryIndex: { partitionKey: "id" },
        });
    f
    • 2
    • 21
  • a

    Adrián Mouly

    07/20/2021, 1:37 AM
    Going back to this issue… looks like this ONLY happens on my functions which runs SQL queries with TypeORM 😩 . Does somebody else had issues with typeOrm and memory leaks?
    f
    • 2
    • 2
  • t

    thdxr

    07/20/2021, 3:10 AM
    Getting a 403 forbidden once I've attached a userpool authorizer to the API. I'm included the
    Bearer
    header - do I need to be granting permission to the pool to call the api?
    f
    • 2
    • 5
  • l

    Louis Barclay

    07/20/2021, 4:59 PM
    How do I set different timeouts for different stacks? I have two stacks - Api and Edge. I want Edge to have a different timeout to Api. I've looked through the documentation, not sure how to achieve this (I can find a way to set timeout at the function level but not at the stack level). Apologies for the basic question - possible that the answer is very obvious! Attached picture of index.js
    t
    f
    • 3
    • 9
  • l

    Louis Barclay

    07/20/2021, 8:33 PM
    Can I use sst to simply create a Lambda function, e.g. one that I want to use in Lambda@Edge contexts? I found Frank's repo here - https://github.com/fwang/sst-edge-lambda-test/blob/main/lib/MyStack.js - which is where I got the code in my screenshot, but it's different from my case. I don't want to create a CF distribution at the same time. What I want is to create and manage several Lambda functions from my SST project that will be used in Lambda@Edge on various existing Cloudfront distributions, without creating them as API endpoints. (The screenshot here doesn't work btw - 'problem linting the source'.)
    f
    • 2
    • 16
1...8910...83Latest