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

    Ömer Toraman

    10/13/2021, 1:24 PM
    Is it possible to use a wildcard for
    LogGroupName
    in
    CloudWatchLogs
    event? For example:
    Copy code
    LogSubscriber:
        Type: AWS::Serverless::Function
        Properties:
          Handler: build/index.handler
          Events:
            ErrorLog:
              Type: CloudWatchLogs
              Properties:
                FilterPattern: 
                LogGroupName: /aws/lambda/*
    f
    • 2
    • 5
  • c

    Camilo Bravo

    10/13/2021, 1:52 PM
    Good morning all! I am noticing something odd. Whenever I deploy my stack though my CI pipeline (github actions) it updates the cdn even though nothing has changed regarding the cdn. Is there something I should be caching in the pipeline to avoid this? In my specific case I was only making changes to the github workflows but CDN kept updating making the builds take 10+ minutes
    t
    f
    • 3
    • 18
  • t

    Thomas Ankcorn

    10/13/2021, 2:53 PM
    Hey when using SST’s static site construct I am having some issues adding a custom domain.
    Copy code
    It seems you are configuring custom domains for you URL. And SST is not able to find the hosted zone "<http://example.domain.com|example.domain.com>" in your AWS Route 53 account. Please double check and make sure the zone exists, or pass in a different zone.
    d
    • 2
    • 11
  • d

    Dan Van Brunt

    10/13/2021, 2:53 PM
    Is there a way to run
    sst build
    where it skips the StaticSite build steps and just uses whats already in the
    .build
    ?
    f
    d
    • 3
    • 4
  • t

    Tony J

    10/13/2021, 2:58 PM
    We have a distributed batch handling part of our system that we’re trying to decrease the total duration on. AWS best practices seem to be basically play guess and check with different batch size configurations until you reach a local min on duration. Aware that sst locally is slower than deploy stacks, but will doing this batch configuration process while running sst locally yield different results than what will actually be seen in prod?
    f
    • 2
    • 2
  • d

    Dan Van Brunt

    10/13/2021, 3:30 PM
    What in
    StaticSite
    is giving the CF Distro access to the bucket? In our CFN we normally create a CF OAI and then give it read access to the bucket to that only the distro can and there is no direct access to the bucket. Seems like you have this working in StaticSite…. but I can’t see anything that sets this up? Is this maybe a sane default of cdk?
    f
    • 2
    • 17
  • d

    Dan Van Brunt

    10/13/2021, 3:42 PM
    @Frank I think I’m going to have to Reimplement
    StaticSite
    as it currently does not seem to allow us to setup an origin group with the one that is created as part of the construct. Or am I missing something?
    f
    • 2
    • 31
  • k

    Kelly Davis

    10/13/2021, 4:05 PM
    How do I detect at deploy time whether a stack + function is deployed in livedev mode so that I can set a different value for an environment variable on the function? So when running sst start I want one value set, and then another value when using sst deploy? Currently I can set an environment variable to override a default, but I'd like the value to be driven by whether live dev is being used or not
    t
    • 2
    • 3
  • d

    Dan Van Brunt

    10/13/2021, 7:25 PM
    Is there a way to setup a http proxy with
    sst.ApiGatewayV1Api
    like you can with
    sst.Api
    ?
    t
    f
    • 3
    • 11
  • k

    Kelly Davis

    10/13/2021, 8:44 PM
    Anyone run into this error before:
    Error: This lambda function uses a runtime that is incompatible with this layer (nodejs14.x is not in [nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, python2.7, python3.6, python3.7, python3.8, python3.9, java8, java8.al2, java11, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, go1.x, ruby2.5, ruby2.7, provided, provided.al2, FROM_IMAGE])
    This just started happening - seemingly randomly - after having worked fine for the last day or so.. The specified runtime that it is complaining about is in fact in the list of compatible runtimes..
    g
    b
    • 3
    • 8
  • k

    Kelly Davis

    10/13/2021, 10:00 PM
    I'm trying to add leveldb as a dependency for a lambda and running into the following error when handling a request in live dev mode:
    Copy code
    No native build was found for platform=darwin arch=x64 runtime=node abi=72 uv=1 libc=glibc node=12.22.6
    
    at Function.load.path (.../node_modules/node-gyp-build/index.js:59:9) ...
    There is a binary dependency,
    leveldown
    which I've tried adding to bundle.nodeModules without success. I've confirmed that locally the darwin-x64 binary is present (in node_modules). I've also confirmed that the issue does not occur when deploying to the lambda to aws. Any suggestions?
    f
    • 2
    • 2
  • a

    Ashishkumar Pandey

    10/14/2021, 11:00 AM
    Anyone here using a monorepo of multiple sst applications with npm? Could you please direct me how to create a simple microservices workflow where every service is a separate sst app?
    s
    o
    +2
    • 5
    • 18
  • s

    Stan

    10/14/2021, 2:39 PM
    Is there any way to define the Function handler inline or pass a js function directly to handler instead of a string containing a path to the file? Something like this:
    Copy code
    import { Function } from "@serverless-stack/resources";
    import { APIGatewayProxyEventV2, APIGatewayProxyHandlerV2 } from "aws-lambda";
    
    export const lambdaHandler: APIGatewayProxyHandlerV2 = async (event: APIGatewayProxyEventV2) => {  
      return {
        statusCode: 200,
        headers: { "Content-Type": "text/plain" },
        body: `Your request was received at ${event.requestContext.time}.`
      };
    };
    
    new Function(this, "MySnsLambda", {
      handler: lambdaHandler
    });
    in the docs I found only this way:
    Copy code
    new Function(this, "MySnsLambda", {
      handler: "src/sns/index.main",
    });
    t
    f
    j
    • 4
    • 11
  • p

    Pranav Tadikonda

    10/14/2021, 6:30 PM
    Hi all, I'm seeing some odd behavior. I have two lambda functions which connect to my MongoDB Atlas instance. I've looked at all the past messages about MongoDB connection re-use between invocations of the same lambda function and believe I have it set up correctly. My code works like this: Lambda Function 1 is connected to an API endpoint and spawns several invocations of Lambda Function 2, which completes some trivial database calls and parsing (~300 ms excluding Mongo connection time) The behavior I'm seeing is that Lambda Function 2 does not re-use any mongo connection on the first invocation (this connection is also taking an abnormally long time (> 10 seconds)) and times out. A minute later, I can see that the invocation is retried automatically and does not re-use the mongo connection and also times out after 10 seconds. Then two minutes, later, the function is retried a third time, which re-uses the mongo connection and completes in 300ms. Any ideas here on what could be going on?
    t
    • 2
    • 10
  • d

    Devin

    10/14/2021, 8:14 PM
    Anyone have an example next app with amplify auth. I almost have mine working but did something wrong with my
    Amplify.configure({...})
    f
    c
    j
    • 4
    • 23
  • e

    Erik Robertson

    10/14/2021, 8:52 PM
    Hello all, I'm getting a
    ERROR Error: Cannot find module '/Users/erik/src/dataworks/dwam-back/.build/src/../config/config.js'
    at runtime in local debug mode when calling the /list lambda endpoint where I'm adding Sequelize. My project structure is like this : /sst.json /package.json /stacks /src/list.js my lambda endpoint, which does an import { db } from '../models'; /models/index.js which does a const config = require(__dirname + '/../config/config.js')[env]; /config/config.js I see two possible issues : 1. In my .build folder there is a src subfolder but no models or config subfolders 2. the error above comes from .build/src/list.js where models/index.js has been included into this flattened version of list.js but in that context the dynamic require could be pointing to a different folder than intended when authoring it (in my case it's ok since src+models+config are under the root / Any help would be welcome. It might be bad JS usage of my end of import/require since I'm not yet fully comfortable with those and the implications, but I've tried other variants without success + it wouldn't address issue #1 AFAIK.
    t
    • 2
    • 9
  • d

    Daniel Bollom

    10/15/2021, 12:56 AM
    Hey everyone 🙂 Started using SST recently and have run across an issue a few times where I start the cli locally but requests still go to the deployed lambda rather than my local. There are no errors in the terminal & everything seems to be working as normal. Stopping and starting locally doesn't help here unfortunately. Anyone else had similar issues before?
    t
    f
    • 3
    • 5
  • k

    kierans777

    10/15/2021, 3:24 AM
    Has anyone got a guide on how to use SST start with WebStorm to debug lambdas?
    t
    s
    +4
    • 7
    • 11
  • s

    Sam Hulick

    10/15/2021, 5:45 PM
    hey team, saw something funky on a deploy from scratch:
    Copy code
    ❌  dev-microservices-api-files failed: Received response status [FAILED] from custom resource. Message returned: A conflicting operation is currently in progress against this resource. Please try again. (RequestId: 9ec1b767-603f-4e10-adda-68185e6353aa)
    any idea why this would happen?
    f
    • 2
    • 10
  • d

    Dennis Dang

    10/15/2021, 7:15 PM
    Exploratory question: what's the general pattern to have SST recognize a lambda with a custom runtime? If I can bundle up a lambda that runs on a custom runtime (using the ocaml runtime), bundle it into a cdk.Function, reuse that as part of an sst.Function, I should hypothetically be able to run that along with SST's live lambda dev setup right?
    t
    a
    • 3
    • 13
  • a

    arda

    10/15/2021, 8:07 PM
    Hey team, I am trying to update my infrastructure but failed with the following error. Essentially, I am just renaming my table.
    • 1
    • 1
  • d

    Dan Van Brunt

    10/15/2021, 8:40 PM
    Has anyone else gotten a TON of
    can only be default-imported using the 'esModuleInterop' flag
    errors when implementing the example code of
    sst.ApolloApi
    ?
    f
    • 2
    • 2
  • d

    Dan Van Brunt

    10/15/2021, 9:07 PM
    Anyone else experience 1.5-2s server response times with simply the default example code for
    sst.ApolloApi
    ? @Frank @thdxr Is this normal? I up’d the memory to 4096 and still averaging 1.5-2s This is just for a hello world reply. in comparison an actual Contentful api call takes avg 10ms
    n
    f
    • 3
    • 23
  • m

    Matthew Smithburger

    10/15/2021, 11:29 PM
    getting
    There are no available API endpoints in your app. Please deploy a service with an API Gateway endpoint.
    error but I do have some endpoints deployed to a dev stage. I am probably missing something simple
    f
    j
    • 3
    • 11
  • k

    kierans777

    10/16/2021, 6:28 AM
    Has anyone figured out how to run SST Jest tests in WebStorm? Just to be sure, I created a brand new SST app, and went to run the test in WebStorm. However the
    jest
    package and Jest config haven't been autodetected.
    s
    f
    t
    • 4
    • 13
  • s

    Saman -

    10/16/2021, 3:05 PM
    Hey. I am trying to set up Cognito Userpool. Everything works fine, just got one question. I want to allow this
    Copy code
    Username - Users can use a username and optionally multiple alternatives to sign up and sign in.
    I want to allow Users to sign in/out with both Username & Email. I want both these attributes to be required. How do I achieve this? BR, Saman
    f
    • 2
    • 21
  • ö

    Ömer Toraman

    10/16/2021, 8:53 PM
    Hello, I’m following the Guide on the official website. When I ran
    npx sts start
    for the first time, it created two stacks (three actually,
    CDKToolKit
    as well) 1.
    dev-notes-my-stack
    2.
    dev-notes-debug-stack
    Anyways, we (me and the Guide) then removed the stack:
    Copy code
    npx sts remove my-stack
    The output stated that it removed the stack (
    dev-notes-my-stack
    ), however, I can still see the Stack on the AWS CloudFormation console. And when I run the above command once again:
    Copy code
    Warning: Setting the stage in the "sst.json" will be deprecated soon. Read more about this change here: <https://docs.serverless-stack.com/working-locally#deprecating-the-stage-option-in-the-sstjson>
    Using stage: dev
    Preparing your SST app
    Transpiling source
    Linting source
    Removing dev-notes-my-stack
    Stack dev-notes-my-stack is not found in your app.
    --- Here’s the CloudFormation Console showing the stacks:
    r
    f
    • 3
    • 8
  • b

    Brinsley

    10/17/2021, 8:02 AM
    Hey guys, got a weird one. Just spun up a new project and one of my lambdas is using an npm module that causes the type checking (on
    npm start
    ) to error out. I'm trying to figure out how to get the type checking to ignore it but I'm at a loss right now. I've added node_modules to the
    ignorePatterns
    array in
    .eslintrc.json
    and to my
    tsconfig.json
    . Any ideas?
    c
    • 2
    • 3
  • ö

    Ömer Toraman

    10/17/2021, 1:20 PM
    Hello! What is the recommended command to create an sst app using TypeScript as language and yarn as packager?
    npx create-serverless-stack@latest my-app --use-yarn --language typescript
    vs
    yarn create serverless-stack my-app --language typescript
    And what is the recommended way to run scripts?
    npx sst start
    vs
    yarn sst start
    vs
    yarn start
    (referencing the script in
    package.json
    )
    r
    t
    • 3
    • 9
  • ö

    Ömer Toraman

    10/17/2021, 2:02 PM
    I’m trying to create an EventBus, and want to add SNS topic as target. Can’t I do it with
    sst.EventBus
    construct? It seems like it only allows for lambda and SQS targets
    o
    • 2
    • 16
1...232425...83Latest