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

    Sean Matheson

    02/22/2022, 3:24 PM
    Howdy all, I am trying to wrap my head around the responsibilities of
    onCreate
    /
    onUpdate
    /
    onDelete
    in the context of the
    sst.Script
    . I am looking to run DB migrations on each deploy. Do I have to mount the lambda against the
    onCreate
    and
    onUpdate
    properties? It is a bit confusing as the docs state that "It gets run on every deployment."
    f
    d
    • 3
    • 9
  • s

    Sam

    02/22/2022, 5:50 PM
    Hey guys, I get this error while testing WebSockets locally, works fine when running on lambda. I'm on v0.65.4 Thanks
    Copy code
    Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"ReferenceError: require is not defined","reason":"ReferenceError: require is not defined","promise":{},"stack":["Runtime.UnhandledPromiseRejection: ReferenceError: require is not defined","    at process.<anonymous> (file:///home/sam/Desktop/wrs/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)","    at process.emit (node:events:394:28)","    at emit (node:internal/process/promises:136:22)","    at processPromiseRejections (node:internal/process/promises:242:25)","    at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
    f
    t
    • 3
    • 27
  • e

    Ernie Francis

    02/22/2022, 7:14 PM
    So more an inquiry, what SST constructor do we have that handles PUB/SUB requests? (outside of GraphQL if possible)
    g
    • 2
    • 1
  • e

    Ernie Francis

    02/22/2022, 8:37 PM
    in SST, i know that we can use
    auth.attachPermissionsForAuthUsers([api]);
    when creating the sst.Auth() constructor. but what if i want to reference an existing already provisioned cognito userpool?
    a
    f
    • 3
    • 13
  • k

    Kujtim Hoxha

    02/22/2022, 10:43 PM
    Is there a way to add a
    *filterPatterns*
    on a kineses stream? I think
    addConsumer
    does not support that but looking at an example in
    SLS
    it looks like it should be possible.
    f
    • 2
    • 7
  • d

    Devin

    02/23/2022, 12:33 AM
    SOLVED:
    Generally you should specify paths relative to SST.json
    --- This might seem obvious but it isn’t to me so if someone knows, I’d appreciate it. I have the following directory structure:
    Copy code
    src/
      lambda-handler/
        rewiter.js
    stacks/
      SiteStatck.js
      index.js
    sst.json
    Inside
    StaticSite
    , I’d like to attach an edge lambda function. That looks vaguely like this:
    Copy code
    const originRewriteHandler = new experimental.EdgeFunction(
          this,
          "OriginRewriteFunc",
          {
            runtime: lambda.Runtime.NODEJS_14_X,
            handler: "src/lambda-handler/rewriter.main",
            // this path is wrong and I can't figure it out
            code: lambda.Code.fromAsset(path.join(__dirname, "lambda-handler")), <----------------------
          }
        );
    Everywhere I go with different paths I end up in
    .build
    t
    • 2
    • 3
  • b

    Bshr Ramadan

    02/23/2022, 1:04 AM
    Hello, When I run
    sst deploy [stack]
    it builds the whole functions and web components for all stacks. How can I just build the constructs related to the specific stack only?
    f
    t
    • 3
    • 7
  • b

    Brinsley

    02/23/2022, 11:16 AM
    Hey guys, anyone had any experience using the
    Script
    construct with VPC resources. Having ongoing woes with a post-deploy migrations script and have hit another wall:
    getaddrinfo ENOTFOUND {rds address}
    Any ideas? Thought it might be a permissions thing so I added a
    PolicyStatement
    to go allow all actions on the arn for the VPC and RDS instance. I’m stuck.
    f
    • 2
    • 2
  • n

    Noah D

    02/23/2022, 11:43 AM
    Hey there does anyone know how to run the
    down
    part of a migration using the new sst RDS construct? Can run
    up
    easily through sst console, but doesn't seem to be an easy way to clear changes if for example I need to change something while in development
    t
    • 2
    • 10
  • r

    Robin

    02/23/2022, 1:32 PM
    We have an SSM parameter that is called at build. We've updated it. It's changed - really. It is. Yet, every time we attempt a deploy or build the old SSM parameter is used. We can't figure out where it's coming from. Has anyone else had this issue? Does SST cache SSM parameters?
    r
    t
    r
    • 4
    • 28
  • a

    Artem Pabacham

    02/23/2022, 2:28 PM
    Hi. I was stuck with this error CREATE_FAILED | AWS:Lambda:LayerVersion | PrismaLayer958161C6 | Could not unzip uploaded file. Please check your file, then try to upload again. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 4fa5aa5e-24be-4cfa-83d5-ef466628c847; Proxy: null) and could not understand what was happening. But it turned out that the reason is that the S3 bucket where SST uploads lambdas and layers zip files is full. So I manually deleted all objects from the bucket and now the deployment works. Is there a way to remove files from SST service bucket (cdk-hnb659fds-assets-660857977215-us-east-1) automatically?
    f
    b
    • 3
    • 6
  • s

    Sean Matheson

    02/23/2022, 3:07 PM
    I've been trying to capture the output of
    sst diff
    into a variable within bash, but it appears the actual CDK diff is output via an inner child process or something. I end up getting something like this:
    Copy code
    ❯ body=$(./node_modules/.bin/sst diff --stage dev)
    Stack dev-foo
    IAM Statement Changes
    ... actual CDK DIFF
    And outputting body variable:
    Copy code
    ❯ echo "$body"
    Using stage: dev
    Preparing your SST app
    Building function src/foo/bar.handler
    ...
    Anyone tried anything similar? I almost have a GitHub action working here. Just need to be able to nab the correct output. 😄
    d
    • 2
    • 4
  • b

    Bshr Ramadan

    02/23/2022, 5:09 PM
    Hello all, I am using github action to deploy, actually it's taking about 40 minutes, and I want to add some integrations tests which requires running
    sst start
    so it will take about 1.5 hour to deploy. Actually when running deploy from local machine, it take much fewer time to deploy, I think because there is some caching process in sst I found that there is a caching option for github actions here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action So I want to ask what files and folders should I cache, is
    .sst
    folder enough?
    t
    • 2
    • 10
  • b

    Brinsley

    02/23/2022, 7:03 PM
    Hopefully the last stupid question of the day: If I wanted all source to be included when a lambda builds (no tree shaking) how do I set this up? I assume i need to do something with the bundle.esbuild config right? @thdxr I imagine you may have some up against something similar sorting out migrations with Kysely?
    t
    p
    • 3
    • 23
  • a

    Austin

    02/23/2022, 7:17 PM
    I didn’t find anything in searching, so apologies if this has already been addressed. Is there any way to invoke EdgeFunctions locally using SST Console, or does that only work specifically with the SST Function construct?
    f
    • 2
    • 1
  • e

    Ernie Francis

    02/24/2022, 1:52 AM
    the console.serverless-stack.com endpoint when starting a serverless-stack keeps stuck on "syncing metadata"
    f
    m
    s
    • 4
    • 5
  • d

    Dan Beaven

    02/24/2022, 2:49 PM
    Having a strange issue where i have the AWS_PROFILE env variable set I can log it from within the stack however it this this error when it tries to deploy the nextjs site?
    Copy code
    Need to perform AWS calls for account my-account, but no credentials have been configured
    Found errors
    f
    • 2
    • 3
  • p

    Pavan Kumar

    02/24/2022, 3:21 PM
    I see for each ApiGateway route a role is created, is that right? If so how to reuse same role for each route.
    f
    • 2
    • 3
  • e

    Ernie Francis

    02/24/2022, 3:50 PM
    i dont want to use a fully custom domain, just prefer to name something like "my-api-thingy.execute-api.us-east-1.amazonaws.com"
    t
    f
    • 3
    • 3
  • e

    Ernie Francis

    02/24/2022, 7:28 PM
    is there a DynamoDB client library for writing simpler queries? i could abstract some of it away myself but wanst sure if there was a NPM package that already does this.
    m
    r
    +3
    • 6
    • 16
  • p

    Pablo Fernandez

    02/24/2022, 7:58 PM
    What should I do to get the new AAAA records after upgrading to 0.65?
    f
    • 2
    • 3
  • r

    Ross Gerbasi

    02/24/2022, 9:11 PM
    Just curious, hopefully I don't start a war here 🙂 Do folks test APIs by deploying to a test stage and running tests that hit those URLs on AWS through APIGateway or do you all like to mock AWS APIGateway events and call your functions directly?
    s
    d
    m
    • 4
    • 28
  • j

    J. T. Garcia

    02/24/2022, 9:24 PM
    Hi all, has anyone seen this error when building? SST version 0.63.0
    Copy code
    EnvironmentCredentialsProviderFailure: Variable AMAZON_ACCESS_KEY_ID not set.
    I'm only seeing it in the ci pipeline, where I've only set
    AWS_ACCESS_KEY
    and
    AWS_SECRET_KEY
    t
    f
    • 3
    • 13
  • d

    Drew

    02/25/2022, 12:32 AM
    External dependencies — this is probably asked all the time. Is there an example of how to build a lambda layer that contains my node module built for my architecture? My steps so far: I added SSH2 as a dependency. I couldn’t deploy it. We flagged it as external. Everything deployed. Now I’m realizing that the lambda doesn’t actually have the module. 😞
    t
    • 2
    • 7
  • e

    Ernie Francis

    02/25/2022, 1:01 AM
    for the seed CI-CD, how do i ignore "The engine "node" is incompatible with this module"
    f
    • 2
    • 1
  • m

    Muhammed Mukhthar CM

    02/25/2022, 11:58 AM
    Hi, I'm trying to build an api service. For example a image background removal service (just for example) I mean, my users will have an api key which they have to include with every request. It will be used to limit the users quota according to billing plans. I'm planning to use supabase for database and auth. Is there any way I can do this with STT?
    f
    r
    • 3
    • 15
  • h

    Henry Villavicencio

    02/25/2022, 12:20 PM
    Hi everyone, I'm trying to build a stack that uses sst.RDS + sst.GraphQLApi and also Prisma as a database client. Prisma needs the database credentials like a URL connection but I don't know how I can get it. Maybe someone can help me please,
    t
    • 2
    • 4
  • j

    John

    02/25/2022, 8:33 PM
    Hi folks, I've followed this guide to start using Aurora in an app I'm building - https://serverless-stack.com/examples/how-to-use-postgresql-in-your-serverless-app.html. This uses the
    data-api-client
    npm package to handle the requests and connection to the DB. I'm getting some timeouts when using this -
    Failed to send response because the Lambda function is disconnected
    I'm wondering can I use the AWS SDK RDS Data Client package instead - https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds-data/index.html#aws-sdkclient-rds-data?
    n
    f
    +2
    • 5
    • 9
  • p

    Patrick

    02/25/2022, 11:04 PM
    Made more sense to post this here: What’s the recommended project structure when using the 
    sst.StackSite
     construct? I’m trying to deploy my CDK app with Seed, but I get an error when building the site because the node_modules for building the site are nested in another folder, and the build pipeline is trying to find it the project root
    Copy code
    ├── sst.json
    ├── node_modules // <- my SST dependencies
    ├── package.json
    ├── stacks
    │   ├── index.tx // <- creates stack for deploying static site in /apps/static-site
    ├── apps
    │   ├── static-site
    │   |   ├── package.json
    │   |   ├── node_modules // <- my React dependencies
    The error I’m getting is 
    react-scripts:not found
     (it’s installed in the 
    static-site
     folder, not the project root) (edited)
    a
    f
    • 3
    • 6
  • t

    Tony J

    02/25/2022, 11:38 PM
    Anyone ever seen this? “Parameter count 201 is greater than max allowed 200”
    f
    • 2
    • 5
1...535455...83Latest