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

    Brinsley

    02/01/2022, 11:30 AM
    Different issue to the above, but looks like the
    Script
    I had configured for
    OnCreate
    can no longer call the function after updating it to also run for `onUpdate`:
    Copy code
    ❌  uat-test-script-postDeploy failed: Received response status [FAILED] from custom resource. Message returned: AccessDeniedException: User: arn:aws:sts::XXXX:assumed-role/uat-test-script-postDeplo-databasemigrationsScript-ZR7JG0WQ7X78/uat-test-script-postDeplo-databasemigrationsScript-RNd8bebkFvd9 is not authorized to perform: lambda:InvokeFunction on resource: arn:aws:lambda:eu-west-2:XXXX:function:uat-test-script-postDeplo-databasemigrationsonUpda-lYXmgfD7kvbZ because no identity-based policy allows the lambda:InvokeFunction action
        at Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)
        at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
        at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
        at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
        at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:688:14)
        at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
        at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
        at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
        at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
        at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:690:12) (RequestId: 8108ca79-2fa1-4df4-800f-6a8d94af4c82)
    Any ideas here?
    j
    f
    • 3
    • 7
  • j

    Jon Holman

    02/01/2022, 3:14 PM
    I was hoping someone here could help me figure this out. I don't know Angular, but I'm trying to create a demo SST app in Angular to show a team of Angular devs how awesome SST is. I am trying to use this as my starting point https://github.com/Manitej66/serverless-stack/tree/angular-app/examples/angular-app . It works great with
    npx sst start
    but it blows up with
    npx sst deploy
    . I'll put more in the thread.
    t
    • 2
    • 5
  • h

    Hubert

    02/01/2022, 4:18 PM
    Hello, I'm trying to replicate a behaviour that I have in SLS which is to have multiple SNS topics send messages to one Lambda. Effectively One Lambda Subscribing 2 topics. However this doesn't seem to be allowed?
    Copy code
    Error: A subscription with id "Topic" already exists under the scope dev-*-metadata-stack/UpdateSnapshot
        at Topic.addSubscription (/home/dev/Documents/*/Github/*/node_modules/aws-cdk-lib/aws-sns/lib/topic-base.ts:61:13)
        at Topic.addFunctionSubscriber (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:231:19)
        at Topic.addSubscriber (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:176:12)
        at /home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:125:46
        at Array.forEach (<anonymous>)
        at Topic.addSubscribers (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:125:17)
        at new MetadataStack (/home/dev/Documents/*/Github/*/lib/metadataStack.js:231:22)
        at Object.main (/home/dev/Documents/*/Github/*/lib/index.js:125:39)
        at Object.<anonymous> (/home/dev/Documents/*/Github/*/.build/run.js:94:16)
        at Module._compile (node:internal/modules/cjs/loader:1101:14)
    Any ideas of a work around? Thanks!
    t
    f
    • 3
    • 14
  • c

    Casiel Didriksson Muriedas

    02/01/2022, 4:39 PM
    Hello! I'm having some issues with my API timing out after 6 seconds, I've set a higher timeout but my API keeps dying. Anyone knows whats causing this? My code looks like this (I'm just waiting 10 seconds)
    Copy code
    export const main: APIGatewayProxyHandlerV2<any> = async (e,context) => {
    
       await wait(10000);
       console.log(context.getRemainingTimeInMillis());
    
      return okHandler({finished:true})
    }
    And the Stack Function looks like this:
    Copy code
    const assetFunction = new sst.Function(this, "assetApiFunction", {
          environment: { ...props.enviroment_vars, functionBatch: functionBatch.functionName },
          handler: 'src/services/query/routes/assets.main',
          timeout:29,
          permissions: ['lambda',"dynamodb"]
        })
    s
    j
    • 3
    • 3
  • j

    Jonathan Chapman

    02/01/2022, 5:45 PM
    Is there a way to add a parameter mapping to an API Gateway proxy integration?
    s
    f
    • 3
    • 13
  • j

    Jon Holman

    02/01/2022, 7:57 PM
    what does
    npx sst deploy --stage test
    run in the frontend directory? Can someone point me to the code for
    sst deploy
    ?
    t
    m
    • 3
    • 49
  • b

    Bshr Ramadan

    02/01/2022, 9:20 PM
    Hello, I am using
    datadog-cdk-constructs
    in my stacks, and I want to update sst and cdk versions. it seems that datadog hadn't support cdk v2 yet. can I add
    @aws-cdk/core
    v1 alongside with
    aws-cdk-lib
    to my package.json, to let datadog keep working until they support v2?
    f
    • 2
    • 1
  • j

    Jon Holman

    02/01/2022, 9:57 PM
    Can I have my SST stacks write outputs to a .env file?
    t
    • 2
    • 2
  • s

    Sahan Amadoruge

    02/02/2022, 9:58 AM
    Is there a way to make
    authorizationType
    Optional?
    f
    a
    • 3
    • 7
  • k

    koukito

    02/02/2022, 11:37 AM
    Hi guys, I'm facing a weird issue working with SST in a lerna monorepo especially in development, my project structure is the following
    Copy code
    monorepo/
         services/
            service1/
               src/
               stacks/
               sst.json
               package.json
            service2/
               src/
               stacks/
               sst.json
               package.json
    package.json
    tsconfig.json
    Assuming i run the service 1 which is a Rest api with lambda and api gateway using
    sst start
    when i invoke the api from the interface i get the error in the picture below. running these same steps when the sst service is outside the monorepo works fine. i think it has to do with the way dependencies are hoisted by lerna. Did any one face such an issue?
    t
    • 2
    • 3
  • b

    Bshr Ramadan

    02/02/2022, 2:03 PM
    Hello, I am getting this error on running 
    sst start
    immediately:
    Copy code
    Failed to fetch resources. NotFoundException: Invalid API identifier specified 702712627781:nguml3fcg8
    does anyone have an idea to discover what's the cause of this error? my sst version is
    0.53.3
    f
    • 2
    • 5
  • t

    Tim V

    02/02/2022, 3:59 PM
    Heya. Regarding Live Lambda Debugging... It seems like the debug web socket is still coming to my local environment, but my lambda updates aren't being applied. It's as if the "artifact" that was initially built on "sst start" is being used. I have to stop and restart "sst start" to get the changes to kick in. Any thoughts on idea on how to troubleshoot or debug this? Works correctly in another project using a slightly older version of SST.
    t
    r
    +2
    • 5
    • 27
  • g

    Garret Harp

    02/02/2022, 9:52 PM
    How do I get sst test to respect my jest.config.ts?
    a
    • 2
    • 2
  • d

    David Garcia

    02/02/2022, 10:07 PM
    Hey, how come when I do a
    app.logicalprefixedname('stack')
    it repeats my stage and name from the
    sst.json
    twice so like
    dev-test-dev-test-stack
    j
    f
    • 3
    • 4
  • m

    Manoel Feliciano

    02/02/2022, 10:28 PM
    Hi guys, does any one know how to configure VSCode debug when a project is inside monorepo? I mean sst.json is not in root.
    s
    • 2
    • 4
  • g

    Garret Harp

    02/03/2022, 1:27 AM
    Trying to run integration tests on a locally running sst instance seems to be really broken. I keep getting errors saying it cannot find module 'create'. For integration testing I am doing a direct lambda invoke to avoid having to generate an auth token and it seems anytime I do direct invokes it is not happy. (currently on sst 0.52.0) Small snippet of the error
    Copy code
    Uncaught Exception {
      "errorType":"Runtime.ImportModuleError",
      "errorMessage":"
      Error: Cannot find module 'create'
        Require stack:
          - C:\\ddd\\node_modules\\@serverless-stack\\aws-lambda-ric\\lib\\utils\\UserFunction.js
          - C:\\ddd\\node_modules\\@serverless-stack\\aws-lambda-ric\\lib\\index.js
          - C:\\ddd\\node_modules\\@serverless-stack\\aws-lambda-ric\\bin\\index.js"
    It worked a few times but I just cannot stop getting the above error no matter what I do now
    f
    • 2
    • 3
  • t

    Tyson

    02/03/2022, 6:45 AM
    Hey all. Looking for anyone who has seen this as a console.log output in an ApolloApi.
    Copy code
    Unable to find function a5d4054a
    It is only happening when I send requests through the frontend app that is using GraphQLCodegen to create Typescript React Hooks (https://www.graphql-code-generator.com). When I make a request using Postman everything is fine. I am hoping to gain some insight into exactly what this error means. Furthermore, the 'a5d405a' code remains the same across networks calls to different lambda resolvers. Resources: ["apollo-server-lambda": "^2.21.1", "@serverless-stack-slack/resources": "0.54.4"]
    j
    f
    • 3
    • 2
  • b

    Bshr Ramadan

    02/03/2022, 1:13 PM
    Hello I am using Apollo graphql federation in my project, they recommend to host the gateway on a server, now I am using the
    ApolloApi
    sst construct for gateway and each service. Can I use
    ec2
    cdk construct to host gateway on, in other words, will it be compatible with other services which is hosted using
    ApolloApi
    construct?
    t
    • 2
    • 2
  • j

    Jędrzej Kuryło

    02/03/2022, 2:10 PM
    hey, what's the best way to debug NextjsSite resource? I've got a simple app that works just fine locally with
    next dev
    and
    next start
    , but when deployed I get 503, so I guess the app returned some sort of error. I'm having trouble finding any trace of error logs in AWS... I can see 3 resources of type
    Custom::SSTEdgeLambda
    created, my guess is that it's one of those that executes my app logic, but I don't see a corresponding log group in Cloudwatch
    Copy code
    CREATE_COMPLETE | Custom::SSTEdgeLambda | xxxImageEdgeLambda6D1A8C9F
    CREATE_COMPLETE | Custom::SSTEdgeLambda | xxxMainEdgeLambdaCD2001DA
    CREATE_COMPLETE | Custom::SSTEdgeLambda | xxxApiEdgeLambda3EC77306
    Any idea how to figure out why the app's failing?
    j
    f
    • 3
    • 3
  • d

    Devin

    02/03/2022, 3:20 PM
    This is likely not a SST issue, more a AWS issue. I am still truly stumped on the above issue. I have a site
    <http://dev.comicshelper.com|dev.comicshelper.com>
    where if you request that URL, it goes ahead and grabs the index.html file and returns it successfully. This site happens to be written in Gatsby but that seems not relevant. Because it’s in Gatsby if you navigate around, links are hydrated and the site works as you’d expect. If however, you navigate directly to
    <http://dev.comicshelper.com/blog|dev.comicshelper.com/blog>
    you get a 403. Document not found. If I go into the bucket, and view it I see it
    Copy code
    index.html
    january-2022/
    If I try to navigate directly to the object in the bucket via the console… I get an Access denied. Do I have something messed up in my cloudfront configuration somewhere. What are some explanations for this document not being delivered?
    j
    • 2
    • 5
  • p

    Paul

    02/03/2022, 4:21 PM
    Hi there, I am unable to reach my sst api via the given
    customDomain
    . I am using the API construct and my config looks like this:
    Copy code
    customDomain: {
       hostedZone: "<http://spedifux.ch|spedifux.ch>",
       domainName: "<http://api-dev.spedifux.ch|api-dev.spedifux.ch>",
       path: "test",
    }
    Have tried to comment out and deploy, than uncomment and redeploy several times now, as I have read that this helps in some cases. Strangely enough I can see the domain is correctly configured in API-Gateway “Custom domain names” and I see the A-Record in Route53 pointing to the correct
    ...execute-api.eu-central-1...
    address. But I always get a “Connection refused” Error when trying to access. Any ideas?
    f
    • 2
    • 4
  • s

    Sean Matthews

    02/03/2022, 5:09 PM
    Aloha! Wondering if anyone else is having issues with deploying on Seed with serverless 3.0.1?
    f
    • 2
    • 27
  • d

    David Garcia

    02/03/2022, 6:07 PM
    Hello, I'm receiving 400 bad request on docker build step during preparation of my SST app, during
    load metadata for public.ecr.aws/sam/build-python3.8:latest
    I'm getting a 400 bad request. What could be causing this?
    j
    • 2
    • 3
  • d

    Dominik Seibold

    02/03/2022, 6:40 PM
    Hey there 🙂 [No unique ID for functions in
    functions.jsonl
    file.] [SST-version: 0.61.0] We are experiencing some weird behavior in the functions.jsonl file. Functions that are created with the same custom Construct are given the same ID in the
    functions.jsonl
    file. When calling the function, the source code in the
    artifacts
    is used where the ID is matched first. Example: We create functions in different services with the same custom CDK construct. Marked in the picture. The ID is the same “b3f05295”. However, in the artifacts folder there is only the source code for “...services/user...” for this ID. Expected behavior: Each function should get a unique ID in the
    functions.jsonl
    file. This way the same code will not be executed for each function. Does anyone else experience this problem?
    t
    f
    • 3
    • 20
  • w

    William Hatch

    02/03/2022, 7:03 PM
    Hello, after ramping up our development, we're now seeing a lot of problems with atlas/mongodb connection timeout failures. During our initial testing, we weren't seeing any connection issues, but once we started ramping up traffic across several functions, we started to see extended periods of connection failures, some as long as an hour, and then, it'll be fine for a while. We have one function in particular, the busiest of them, that is plagued by these issues. After looking at the atlas logs, we noticed a LOT of authentication errors, which weren't really errors, but due to atlas only supporting SHA-1, and if you're using later mongodb npm, it will first try with SHA-256, but will subsequently try with SHA-1. Thinking our issues might be related to this thrash, we explicitly set the auth type in the connection string, which resolved the errors on the atlas side, but still experiencing the connection timeouts. We are far under our connection limit for our atlas cluster, and scoured the security groups, network acl's, etc. Our setup is a typical peered VPC with atlas, and followed the guide https://serverless-stack.com/examples/how-to-use-mongodb-atlas-in-your-serverless-app.html as to how to setup the connection caching, etc. I've found another post where they aren't bothering with the VPC peering, and are not experiencing issues. I almost feel this has to be something going on at the AWS networking level. We see nothing in the atlas logs, and if it were an acl, routing or security group issue, it would always fail. I'm creating some cloudwatch metric graphs so we see the behavior across all functions that have this issue, over time and look for correlations, but that's not going to solve the problem itself. Not sure what else to do to debug.
    g
    a
    b
    • 4
    • 13
  • a

    Ara Yeressian

    02/03/2022, 7:17 PM
    Hello, I’m trying to integrate TypeORM and typeorm-aurora-data-api-driver with SST. Right now I’m getting
    Copy code
    {
      "errorType": "Runtime.UnhandledPromiseRejection",
      "errorMessage": "ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
      "reason": "ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
      "promise": {},
      "stack": [
        "Runtime.UnhandledPromiseRejection: ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
        "    at process.<anonymous> (file:///Users/ayeressian/personal/my-sst-app/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)",
        "    at process.emit (events.js:376:20)",
        "    at processPromiseRejections (internal/process/promises.js:245:33)",
        "    at processTicksAndRejections (internal/process/task_queues.js:96:32)"
      ]
    }
    Function
    Copy code
    ...
    const api = new sst.Api(this, "Api", {
          routes: {
            "GET /": {
              function: {
                handler: "src/function/db.handler",
                environment: {
                  DATABASE,
                  CLUSTER_ARN: cluster.clusterArn,
                  SECRET_ARN: cluster.secret!.secretArn,
                },
                bundle: {
                  esbuildConfig: {
                    plugins: "./esbuild-config.js",
                  },
                  nodeModules: ["typeorm", "typeorm-aurora-data-api-driver"],
                },
                permissions: [cluster],
              },
            },
          },
        });
    tsconfig.json
    Copy code
    {
      "compilerOptions": {
        "experimentalDecorators": true
      },
      "extends": "@tsconfig/node14",
      "include": [
        "stacks",
        "src"
      ]
    }
    Any help would be appreciated.
    a
    • 2
    • 3
  • a

    Adam Fanello

    02/04/2022, 12:53 AM
    Just want to make sure I'm not about to head down a path to insanity.... I should be able to use CDK Pipelines within Serverless Stack, yes?
    a
    a
    +2
    • 5
    • 11
  • e

    Emanuel Quimper

    02/04/2022, 2:16 PM
    Hello Quick question 🙂 If I want to access a local file -> "google credentials json file" where should I put this file in the project ?
    t
    t
    • 3
    • 8
  • e

    Emanuel Quimper

    02/04/2022, 3:36 PM
    Do we have a way to destroy a project build with sst ?
    r
    t
    • 3
    • 4
  • d

    Derek Kershner

    02/04/2022, 4:46 PM
    Just for clarification, to convert a Node 14 Lambda from being bundled as CJS to being bundled as ESM, all that is required is to mark https://docs.serverless-stack.com/constructs/Function#format to
    esm
    ? All should be well, tree-shook, etc?
    r
    f
    • 3
    • 4
1...484950...83Latest