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

    Jon Baker

    04/26/2022, 1:05 PM
    HI Everyone I’m new here and migrating my Lambdas from Serverless.yml to Serverless-Stack. I’m using V1 constructs but also tried with the 0.x constructs before upgrading and got the same error that I’m struggling to resolve. If I run my code using
    yarn start
    then I don’t have any issues but if I do a
    yarn deploy
    I get an
    Expected signal to be an instanceof AbortSignal
    error. It seems related to
    node-fetch
    requests (The lambda uses the Airtable NPM to request some data from Airtable). I’m guessing there are some permissions needed perhaps I’ve got no VPC’s and it’s not really clear? Anyone seen this or able to help? My Stack is configured as follows:
    Copy code
    const api = new sst.Api(this, 'Api', {
          authorizers: {
            feAuthorizer: {
              type: 'jwt',
              jwt: {
                issuer: process.env.ISSUER,
                audience: [process.env.AUDIENCE],
              },
            },
          },
          defaults: {
            authorizer: 'feAuthorizer',
          },
          routes: {
            'GET /': 'src/lambda.handler',
            'POST /new-member': {
              function: {
                handler: 'src/newMember/newMemberHandler.handler',
                environment: {
                  FE_CLIENT_ID: process.env.FE_CLIENT_ID,
                  FE_SECRET: process.env.FE_SECRET,
                  FE_TENANT_ID: process.env.FE_TENANT_ID,
                  AIRTABLE_API_KEY: process.env.AIRTABLE_API_KEY,
                  AIRTABLE_BASE_ID: process.env.AIRTABLE_BASE_ID,
                  MONGO_URI: process.env.MONGO_URI,
                },
              },
            },
          },
        });
    f
    • 2
    • 11
  • m

    Meris Tarhanis

    04/26/2022, 1:08 PM
    Hello everyone. Just for info I am using RDS(Postgres) with my SST for the backend. My SST version is "0.65.6". I am having an issue with:
    Copy code
    Failed to send response because the lambda function is disconnected
    How it happens: • I send API request to my API • API recognizes the request and triggers the right lambda • lambda starts doing its work, parses in the data from the request body, sends the query to the RDS etc.. • I receive the Internal Server Error, 500 as response to my request • SST send me the above message ("Failed to send response because the lambda function is disconnected") • SST prints out the "real" response Message in the console, (200, body of a successful request*) What I think is the problem: My lambda function doesn't wait for the Response from the DB before sending it back to the client. So my question is, how do I make my lambda functions pre-connect to the RDS and wait out for the response?
    r
    t
    f
    • 4
    • 24
  • d

    Dillon Peterson

    04/26/2022, 7:45 PM
    I'm trying to use that Amplify Federated Signin with token I'm getting back, assuming that is right direction. This is error I'm getting.
    f
    • 2
    • 3
  • r

    Ryan Barnes

    04/26/2022, 8:45 PM
    Is there a way to setup a DbProxy infront of the RDS serverless aurora? https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-rds.DatabaseProxy.html The
    ProxyTarget.fromCluster()
    is looking for an
    IDatabaseCluster
    object. I can't seem to get that from the serverless stack resources.
    f
    • 2
    • 13
  • m

    Mark Fox

    04/26/2022, 10:28 PM
    Hi. I just finished the excellent guide and wanted to replace the React frontend with one implemented in Nuxt/Vue. Started by moving
    frontend
    to a safe place and a
    npx create-nuxt-app frontend
    , then changed FrontendStack.js to use StaticSite with appropriately changed buildOutput and buildCommand values in the props object. Tried to deploy through SEED and it fails during the unit tests in frontend, complaining that it "Cannot find module '{ATSYMBOL}vue/test-utils'". (Slack keeps replacing my text with a user's name.) Locally, a
    npm run test
    fails with a similar "Cannot find module '@/components/NuxtLogo.vue' [...]". I think this is just a Jest issue with nested projects.
    d
    a
    • 3
    • 4
  • g

    Giorgio

    04/26/2022, 11:23 PM
    Hi everyone 👋 . I'm running into a circular dependency issue, I'm trying to grant unauthenticated access to an sst.AppSyncApi resource by referencing the unauth role created by sst.Auth. For example:
    Copy code
    const auth = new sst.Auth(this, 'Auth');
    const api = new sst.AppSyncApi(this, 'Api', {
      cdk: {
        graphqlApi: {
          authorizationConfig: {
            defaultAuthorization: {
              authorizationType: appsync.AuthorizationType.IAM
            },
            additionalAuthorizationModes: [{
              authorizationType: appsync.AuthorizationType.USER_POOL,
              userPoolConfig: {
                auth.cdk.userPool,
                defaultAction: appsync.UserPoolDefaultAction.DENY,
              },
            }]
          },
        },
      },
    });
    api.cdk.graphqlApi.grantQuery(auth.cdk.unauthRole, 'nameOfMyQuery');
    The error I'm getting is:
    Copy code
    Error: 'dev-my-app-auth' depends on 'dev-my-app-api' (dev-my-app-auth -> dev-my-app-api/GraphqlApi/Api/Resource.ApiId). Adding this dependency (dev-my-app-api -> dev-my-app-auth/Auth/UserPool/Resource.Ref) would create a cyclic reference.
    Is there any other way to set this up? What I'm basically trying to do is to set up the AppSync API to have both authenticated access via user pool and a single query to have unauthenticated access.
    d
    f
    • 3
    • 11
  • k

    Karolis Stulgys

    04/27/2022, 7:02 AM
    I see this example with
    postgresql
    db. Can I use it with
    prisma
    in my SST app? https://serverless-stack.com/examples/how-to-use-postgresql-in-your-serverless-app.html
    f
    • 2
    • 10
  • s

    Scott

    04/27/2022, 7:53 AM
    Is there any existing guides/guidance for working with
    typeORM
    for serverless-stack, or is the consensus to use
    kysely
    instead? [Postgres Aurora Serverless] (I'm converting an existing serverless project to serverless-stack that currently uses typeORM, so I'm weighing up the challenges of converting vs wiring up typeORM)
    f
    k
    • 3
    • 16
  • k

    Karolis Stulgys

    04/27/2022, 2:43 PM
    I have nestjs server exposed as lambda. How can I pass environment variables to that lambda/nestjsapp?
    f
    • 2
    • 4
  • ö

    Ömer Toraman

    04/27/2022, 5:51 PM
    Anyone having issues boosting their development/local environment?
    r
    s
    • 3
    • 18
  • k

    Karolis Stulgys

    04/27/2022, 7:52 PM
    What is the main difference between Amplify and SST? What can you do In SST that you can't in Amplify and vice versa? In what case would you chose one versus another?
    t
    a
    +4
    • 7
    • 10
  • ö

    Ömer Toraman

    04/27/2022, 8:05 PM
    I’m having trouble starting the local environment. It was working all fine till today. I’m not really sure what the problem is. I removed all of the stacks through the CloudFormation Dashboard, and tried to deploy again, but no good. So I tried to create a brand new SST app, but the same problem persists. I’m not able to deploy the debug stack on a fresh serverless stack app.
    Copy code
    $ npx create-serverless-stack@latest demo --language typescript --use-yarn
    
    $ cd demo
    
    $ aws-vault exec sg-omer -- npx sst start --stage dev --verbose
    I don’t see any CloudFormation Stack in progress:
    f
    • 2
    • 36
  • h

    Haider Abbas

    04/27/2022, 10:06 PM
    Hey Folks, I’m trying to upgrade my existing Database from Aurora MySQL 2.10.2 (MySQL 5.7) to Aurora MySQL 3.01.1 (MySQL 8.0), but it didn’t works and gives me error
    Copy code
    Database cluster is in a state that cannot be upgraded: PreUpgrade checks failed. More details can be found in the upgrade-prechecks.log file. Please refer to <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.MySQL80.html#AuroraMySQL.mysql80-upgrade-troubleshooting> for more details on troubleshooting the cause of the upgrade failure.
    I also checks the pre-patch compatibility logs but it didn’t gives me anything beside InnoDB engine authentication and some other DB server details, there is something incompatible that i’m missing which is preventing them from doing so.
    My end motive is  Aurora MySQL 2.10.2 (MySQL 5.7) --> Aurora MySQL 3.01.1 (MySQL 8.0) --> Aurora MySQL 3.02.1 (MySQL 8.0) --> Aurora Serverless
    So far i didn’t find a way to handle this. May be some of you guys are familiar with this issue, please help me to figure this out. Great Thanks for your precious time
    f
    • 2
    • 2
  • k

    Karolis Stulgys

    04/28/2022, 6:01 AM
    Is there migration guide from SST Jasvascript project to Typescript?
    b
    f
    m
    • 4
    • 5
  • k

    Karolis Stulgys

    04/28/2022, 9:30 AM
    How do I limit calls per minute to my api endpoint/lambda?
    a
    f
    • 3
    • 8
  • a

    Alfred Brose

    04/28/2022, 10:09 AM
    Hi fellow SST users/developers! I'm wondering if there is a way to initialize a new sst project using create-serverless-stack using
    --language python
    and setting/specifying typescript for the stack definitions? Now everything gets generated in typescript when using
    --language typescript
    but with python the stack definitions are getting created as js files and we need to manually "convert" everything to typescript
    f
    • 2
    • 4
  • k

    Karolis Stulgys

    04/28/2022, 12:14 PM
    What did I do so I can not commit my frontend folder to gthub?
    c
    • 2
    • 2
  • k

    Karolis Stulgys

    04/28/2022, 12:51 PM
    Can I have multiple frontends?
    Copy code
    const frontendOne = new sst.NextjsSite(this, "frontendOne", {
          path: "frontendOne",
        });
        const frontendTwo = new sst.NextjsSite(this, "frontendTwo", {
          path: "frontendTwo",
        });
    
        this.addOutputs({
          SiteUrl: frontendOne.customDomainUrl || frontendOne.url,
          ApiEndpoint: api.customDomainUrl || api.url,
        });
    f
    d
    • 3
    • 7
  • i

    Islam Salem

    04/28/2022, 2:36 PM
    Hi all has anyone tried to pass dependency between two stacks in different regions as in this solution https://stackoverflow.com/questions/59774627/cloudformation-cross-region-reference/63559786#63559786 I’m trying to set it up with custom resources as in the example but I’m getting lack of permissions error: ❌ Islam-Salem-metatrust-com-met-match-service-MailReceiver failed: Received response status [FAILED] from custom resource. Message returned: User: arnawssts:0xxxxxxxxxxxxassumed-role/Islam-Salem-metatrust-com-AWS679f53fac002430cb0da5-14GZHEC5E8LWA/Islam-Salem-metatrust-com-AWS679f53fac002430cb0da5-ZKnTcwE6TYSS is not authorized to perform: ssm:GetParameter on resource: arnawsssmeu central 1072408395743:parameter/EMAIL_HANDLER_FUNCTION_ARN_SSM_PARAM because no identity-based policy allows the ssm:GetParameter action
    f
    • 2
    • 15
  • d

    Dan Van Brunt

    04/28/2022, 6:25 PM
    [Production] In the middle of a prod push and
    StaticSite
    is erroring out with
    [Error at /prod-idx-main/GatsbySite] Found zones: [] for dns:subdomain.klick.com, privateZone:undefined, vpcId:undefined, but wanted exactly 1 zone
    when we try to run
    npx sst diff prod-idx-main --stage prod --profile NOT_TELLING
    f
    s
    • 3
    • 14
  • a

    Ashishkumar Pandey

    04/29/2022, 12:52 AM
    how do I go about debugging this error :-
    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:///Users/ashish/work/planet-marathi/api-v2/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)","    at process.emit (node:events:527:28)","    at emit (node:internal/process/promises:140:20)","    at processPromiseRejections (node:internal/process/promises:274:27)","    at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
    t
    b
    • 3
    • 6
  • s

    Sahan Amadoruge

    04/29/2022, 8:56 AM
    Hey, I am using a Queue and it's get repeated 😕 Any idea why it's happening?
    f
    • 2
    • 2
  • h

    Harish Venkatesan

    04/29/2022, 9:34 AM
    Hi team, I a little new to SST. Could I understand when I should use IAM vs JWT for the API Authorizer? My use case is that I want users to sign up with Cognito user/identity pool. I also have custom attributes for each user, such as
    userID
    and
    departmentID
    which I need to receive after the authorisation in the API
    event
    object of API handler. I have tried using "IAM" as the Auth option, but I am not getting any custom attributes in my
    event
    object. Could someone advise on what is the best way to approach this?
    k
    f
    • 3
    • 4
  • k

    Karolis Stulgys

    04/29/2022, 11:17 AM
    Is there something similar like
    sst.NextjsSite
    construct to Remix to deploy Remix site?
    f
    s
    • 3
    • 3
  • a

    Ashishkumar Pandey

    04/29/2022, 2:43 PM
    How can I create API routes such as
    <http://auth.abc.xyz/.well-known/openid-configuration|auth.abc.xyz/.well-known/openid-configuration>
    and
    <http://auth.abc.xyz/.well-known/jwks.json|auth.abc.xyz/.well-known/jwks.json>
    using the
    sst.Api
    construct. Is this doable, I’m trying to create an openid discovery endpoint for a custom auth service so there’s no way I can use another route.
    f
    p
    t
    • 4
    • 18
  • b

    Bala Chalasani

    04/29/2022, 2:43 PM
    Hi all, I am new to SST, following through the guide, really enjoyed the experience so far. Quick question, where is the file created and the name of the file with the environment variables for ReactStaticSite with the variables in the environment prop?
    f
    • 2
    • 3
  • a

    Austin

    04/29/2022, 3:03 PM
    Is it possible to use .NET 6 runtime with SST? I know it is supported by Lambda now, and I see it is supported by the CDK itself, but I haven’t been able to get it working with an SST project. Let me know if someone can clarify this isn’t supported or if I’m just doing something wrong? The same project setup works with a .NET 3.1 project
    f
    k
    a
    • 4
    • 22
  • e

    Ernie Francis

    04/29/2022, 7:05 PM
    i use react-snap to generate static pages,
    f
    • 2
    • 7
  • l

    lgupta

    04/29/2022, 7:19 PM
    Hi Everyone, I am creating a new project with SST. My project also requires integration with Elasticache. Is there a way to implement it with SST? Thanks cc: @Frank @Jay
    f
    • 2
    • 7
  • h

    Henry Gomez

    04/29/2022, 10:13 PM
    Hi guys, just starting with sst. Trying to use ejs templates in a test project to send emails. But my "src/templates" folder is not included inside artifacts folder. any idea? thks
    f
    • 2
    • 6
1...676869...83Latest