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

    Mendel Lerner

    03/25/2022, 8:23 PM
    Hi Everyone, I'm having trouble with the local dev environment. I have a Lambda in a VPC with a Security Group that allows all egress, triggered by an S3 event. It works fine when fully deployed. When using the local dev environment, it simply hangs and times out (even for much longer time limits):
    Copy code
    2022-03-25T16:19:13.067-04:00	START RequestId: 31bcc1ae-8648-4f40-84c5-a2574533fe58 Version: $LATEST 
    2022-03-25T16:19:13.156-04:00	2022-03-25T20:19:13.097Z 31bcc1ae-8648-4f40-84c5-a2574533fe58 INFO connectAndSendMessage()
    2022-03-25T16:19:18.076-04:00	END RequestId: 31bcc1ae-8648-4f40-84c5-a2574533fe58
    2022-03-25T16:19:18.076-04:00	REPORT RequestId: 31bcc1ae-8648-4f40-84c5-a2574533fe58 Duration: 5007.89 ms Billed Duration: 5000 ms Memory Size: 128 MB Max Memory Used: 80 MB Init Duration: 469.73
    Any ideas for what to troubleshoot?
    t
    f
    +2
    • 5
    • 8
  • m

    Mendel Lerner

    03/25/2022, 8:24 PM
    Another question: My local dev often gets stuck at:
    Copy code
    Stacks: Deploying completed.
    but doesn't resume the live environment.
    a
    f
    • 3
    • 5
  • a

    Adrian Schweizer

    03/25/2022, 11:11 PM
    hmmm, I just encountered an error on prod that I don't have in local dev
    t
    • 2
    • 17
  • r

    Rob N

    03/25/2022, 11:58 PM
    In a monorepo setup, my understanding is your suggestion is to have the sst.json in the root directory outside of the services correct? How do you then only work on a single service when you would have to have all the stacks defined in one index.ts? P.s loving SST and its community 🙂
    t
    a
    +2
    • 5
    • 25
  • s

    sumitavo biswas

    03/26/2022, 12:38 PM
    @Jay @Frank Hello Guys, need an urgent blocker help from you all. I am defining a cron job inside my stack but to my surprise cannot assign an environment variable to the same Below is the code. The testprop never appears in the lambda env variable this.cronJob = new sst.Cron(this, "bitbucket-scheduler-cron", { schedule: "rate(5 minutes)", job: { function: "src/bitbucket-api/scheduler.main", environment: { testprop: this.bitbucketJobTable.dynamodbTable.tableName, }, }, }); this.cronJob.attachPermissions([ this.bitbucketScheduleJobTable, this.bitbucketJobTable, auditLogTable, errorLogTable, ]);
    r
    a
    +2
    • 5
    • 20
  • s

    Sam Hulick

    03/26/2022, 6:33 PM
    if I specify a handler in an HTTP API route, e.g.
    handler: 'presentation/server.handler',
    , wil SST look for
    server.js
    in addition to
    server.ts
    if the latter doesn’t exist?
    f
    • 2
    • 2
  • b

    Boris Tane

    03/26/2022, 8:19 PM
    has anyone ever deployed a serverless-stack project from within a lambda? I'm about to embark on this journey and I want to know if there are any gotchas to be aware of before hand
    f
    • 2
    • 3
  • a

    Adrián Mouly

    03/28/2022, 5:40 AM
    Hey guys, I’m creating a
    Distribution
    from CFront with CDK, but my
    domainName
    is not owned by my AWS account, it’s “external” to Route53. Using CDK construct, I’m getting errors… but on SST, when deployed
    StaticWebsite
    there is a property `isExternalDomain`… HOW I can replicate the same behavior from SST but with CDK?
    f
    • 2
    • 3
  • a

    AS

    03/28/2022, 9:26 AM
    Is it possible when creating a project to choose a different language for the app versus for CDK? Example: App using Go while CDK is Typescript
    r
    f
    • 3
    • 4
  • y

    Yohann B

    03/28/2022, 2:04 PM
    Hello, when i organize my code, let's say an import, and then i destructure the object like ...routes in a getaway, the sst cli does not detect the changes, thus preventing me to organize my code in different files. Did i miss somehting ? CLI says 'no change', even if i changed the content of routes.ts
    f
    • 2
    • 2
  • p

    Pavan Kumar

    03/28/2022, 3:54 PM
    How can I add custom domain name to API Gateway in situation where domain is not hosted in Route 53? For example I am using external DNS provider and I can add record manually. Right now when I use custom domain name I get this error.
    Copy code
    privateZone:undefined, vpcId:undefined, but wanted exactly 1 zone
    f
    • 2
    • 2
  • b

    Bshr Ramadan

    03/28/2022, 5:13 PM
    Hello, I faced an error on deploying saying that I reached limit of s3 buckets I removed many s3 buckets, and one of them had a name containing
    cdk
    and another things. Now I am trying to deploy again and getting this error on deploying debug stack:
    Copy code
    fail: No bucket named 'cdk-hnb659fds-assets-7027#####81-us-east-1'. Is account 7027####781 bootstrapped?
    So should I delete
    cdk-toolkit
    stack from aws because it has been corrupted?
    f
    • 2
    • 5
  • f

    Frank Faubert

    03/28/2022, 6:47 PM
    I’m looking for some sample code / docs / best practices for using SST with kysely + lambda + planetscale (specifically). I’m very interested in seeing how to connect to the database, how / where in the repo the schema is defined, how schema migrations are handled down the line, etc. Thank you!
    t
    • 2
    • 15
  • r

    Rob N

    03/28/2022, 9:50 PM
    Hey, if you add some default env vars in the main method in index.ts file can you reference them in the stack files somehow? e.g.
    /stacks/index.ts
    Copy code
    app.setDefaultFunctionProps({
        runtime: lambda.Runtime.NODEJS_14_X,
        environment: {
          SSM_PREFIX: `/${ssmStage}/`,
          SSM_SHARED_PREFIX: `/${ssmStage}/shared/`,
        },
      });
    Looking to access the
    SSM_PREFIX
    in stack definitions, or should I be just passing them in via props?
    r
    k
    • 3
    • 4
  • b

    Bshr Ramadan

    03/28/2022, 11:52 PM
    Hello, I want to ask is there a way to configure logs retention of
    NextJsSite
    construct resources? I have a high billing in cloudwatch and want to configure retention to reduce it I used
    app.setDefaultFunctionProps
    but it's not changing the logs of nextjsSite
    d
    • 2
    • 2
  • l

    leonard

    03/29/2022, 1:38 AM
    Hi, is there a guide to use an orm for aurora postgres?
    t
    s
    r
    • 4
    • 9
  • t

    Tony J

    03/30/2022, 1:59 AM
    Hi. Was wondering if anyone else has come across this Lambda invoke error? Surprisingly, not much online about it I could find.
    f
    • 2
    • 2
  • r

    Roberto Salim

    03/30/2022, 3:23 AM
    Hi, I updated my api stack to add a new GET endpoint (added the following line under routes under ApiGatewayV1Api.
    "GET /v2/": "src/handlers/getItem/index.handler",
    Prior to this I only have 1 POST endpoint and it was working fine, and after adding this line I always have this error:
    Copy code
    dev-roberto-api | CREATE_FAILED | AWS::Lambda::Function | apiLambdaPOSTv2new9C13E3AA | dev-roberto-api-index already exists in stack arn:aws:cloudformation:ap-southeast-1:352681053372:stack/dev-roberto-api/62bc2690-afd7-11ec-8c9b-0a3affc3188a
    dev-roberto-api | CREATE_FAILED | AWS::Lambda::Function | apiLambdaGETv205ED50C9 | Resource creation cancelled
    Does anyone know why or how to resolve this? Thanks in advance! 🙏
    t
    • 2
    • 3
  • a

    Ash Rhazaly

    03/30/2022, 7:41 AM
    Any suggestions on how to retrieve multiple secrets from secrets manager within the API stack? Seems that singular secret retrieval is the only possible option ( I definitely think I'm missing something )
    Copy code
    Error: There is already a Construct with name 'SecretFromCompleteArn' in ApiStack
    Copy code
    private getSecrets(ssmString: string): string {
        const secretsManagerArn = StringParameter.valueForStringParameter(this, ssmString);
    
        const { secretValue } = Secret.fromSecretCompleteArn(
          this,
          "SecretFromCompleteArn",
          secretsManagerArn
        );
    
        return secretValue.toString();
      }
    Copy code
    const api = new sst.ApiGatewayV1Api(this, "api", {
          defaultFunctionProps: {
            environment: {
              ...database.environments(),
              CREDENTIALS_ONE: this.getSecrets(ssmString1),
              CREDENTIALS_TWO: this.getSecrets(ssmString2),
              NODE_ENV: stage,
            },
          },
    b
    t
    • 3
    • 14
  • m

    Meris Tarhanis

    03/30/2022, 11:27 AM
    I am trying to signup the user to the cognito when I send the API request to add the user to the DB, any idea how can this be done? Maybe the answer is obvious but I don't see it.
    t
    k
    • 3
    • 3
  • a

    Artemiy Davydov

    03/30/2022, 1:01 PM
    https://stackoverflow.com/questions/47390896/disabling-cache-for-cloudfront Does anyone know how to do this with modern SST?
    t
    f
    • 3
    • 5
  • r

    Robert Chandler

    03/30/2022, 1:10 PM
    Sorry to cross-post but I'm keen to know the answer as it's blocking getting our integration tests to work nicely
    t
    f
    • 3
    • 2
  • m

    Meris Tarhanis

    03/30/2022, 2:20 PM
    So I tried switching up the API stack that the Frontend and Auth Stack uses, and I am getting this error (picture below). To better explain the problem, we were using DynamoDB in the old storage stack, so following the tutorial here: https://serverless-stack.com/examples/how-to-use-postgresql-in-your-serverless-app.html, I made a new stack called MyStack and put all the API resources that I use inside it. Old API stack is not usable anymore so I made the changes inside stacks/index.js and passed in the new api from myStack into the authStack and FrontendStack. How do I fix this problem where it's asking me for the tableArn where I am not even using DynamoDB tables?
    t
    k
    • 3
    • 2
  • s

    Slackbot

    03/30/2022, 2:38 PM
    This message was deleted.
    t
    m
    • 3
    • 5
  • a

    Adrian Schweizer

    03/30/2022, 2:53 PM
    What do I have to configure to be able to access public resources in a bucket from within react?
    f
    • 2
    • 13
  • a

    Andrew Blaney

    03/30/2022, 6:04 PM
    is anyone using
    pnpm
    with
    v0.69.3
    ?
    sst build
    seems to be broken due to this change (code dump in thread)!
    f
    • 2
    • 6
  • j

    Jacob Hogenkamp

    03/30/2022, 6:11 PM
    Hello, I’m working on migrating a serverless framework service to SST and am struggling to figure out how to reference already existing resources within SST. For example, in my serverless.yml file, I reference stage dependent ddb tables like so:
    Copy code
    provider:
      environment:
        myTableName: ${cf:myOtherService-${self:provider.stage}.TableName}
    Then I dereference
    myTableName
    from
    process.env
    within the lambda. What is the best way to do this within SST?
    r
    s
    • 3
    • 5
  • a

    Adrián Mouly

    03/30/2022, 10:23 PM
    Hey guys, Is somebody using Lambda + k8s running on EC2? I need my Lambda to hit a service running on my k8s cluster. But I can’t figure out what inbound rule and such need to be configured. Can somebody help?
    j
    t
    • 3
    • 6
  • s

    Steven Baker

    03/31/2022, 11:40 AM
    Hi all, I have only just started. On Ubuntu and just did the very first steps in the Quick start. My app throws an error when visiting the API GW endpoint, but only when running in npx sst start. The error does not appear if I hit the deploy endpoint without any code differences. Error is: file:///.../tmp/my-sst-app/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34 const error = new Errors.UnhandledPromiseRejection(reason?.toString(), promise); ^ SyntaxError: Unexpected token '.' at Loader.moduleStrategy (internal/modules/esm/translators.js14018)
    f
    • 2
    • 3
  • m

    Meris Tarhanis

    03/31/2022, 12:30 PM
    Hey guys, did you every try to configure Amplify inside a Stack? (I need it in order to Auth.SignUp() user when I add him to my DB). Is there any workaround?
    g
    r
    +3
    • 6
    • 22
1...616263...83Latest