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

    Carlos Thurber

    06/18/2022, 2:03 PM
    hopefully a quick question about the
    Script
    construct 🙂 I have a
    Script
    in one of my stacks, and when deploying (or working locally) I always see it updating like
    Copy code
    dev-homes-app-system-configuration | UPDATE_IN_PROGRESS | Custom::SSTScript | ScriptsScriptResource45A648A2
    dev-homes-app-system-configuration | UPDATE_COMPLETE | Custom::SSTScript | ScriptsScriptResource45A648A2
    This happens even when there are no changes to this script or to that stack. Is this normal for Scripts? or should I look more deeply for the cause?
    t
    • 2
    • 6
  • k

    Karolis Stulgys

    06/18/2022, 2:30 PM
    👋
    Install the @sls-next/lambda-at-edge package by running the following in the project root.
    sst project root or /frontend project root? This dep also does not exist in example repo: https://serverless-stack.com/examples/how-to-create-a-nextjs-app-with-serverless.html
    a
    • 2
    • 21
  • j

    Jon Holman

    06/18/2022, 3:06 PM
    when I authenticate into my SST app using Google credentials, is it possible to have the user login and authorize the application one time, but that authorization include cognito and google APIs? I've done the cognito, app, AWS access many times, but now I'm trying to figure out how to get the tokens required to access google's APIs, like google drive.
    f
    • 2
    • 1
  • a

    Andrew Brown

    06/18/2022, 4:16 PM
    When you create a React app how do you actually deploy it your static website hosting during debugging? @thdxr The guides jump into building a react app, and there is later section on production deployment pipelines.
    t
    a
    • 3
    • 7
  • s

    Slackbot

    06/18/2022, 5:34 PM
    This message was deleted.
  • k

    Kevin Procopio

    06/18/2022, 7:52 PM
    I'm having an issue where I get the following error
    Copy code
    Deploying stacks
    Error: ENOENT: no such file or directory, uv_cwd
    at process.wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:126:28)
    ...
    It occurs whenever I make a change to any code. I'm running sst in WSL on Windows, using VSCode. If I restart my machine it will let me do a deployment, but as soon as I make a new edit to the lambda.py code (either via vim or VSCode), the error recurs. Any idea why this is the case?
    f
    • 2
    • 5
  • s

    Slackbot

    06/18/2022, 8:54 PM
    This message was deleted.
    f
    • 2
    • 1
  • d

    Derek Kershner

    06/18/2022, 10:27 PM
    installing SST in a monorepo sometimes breaks all CDK apps in that monorepo Getting an error again
    Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/derekkershner/repos/resonance-infrastructure-foundations/node_modules/@serverless-stack/resources/package.json
    This time removing peerDependencies from the lib that builds on SST didnt work. Version
    1.2.25
    . Original time I got error: https://serverless-stack.slack.com/archives/C01JG3B20RY/p1653704371418879
    t
    • 2
    • 70
  • j

    Jon Holman

    06/19/2022, 1:07 AM
    How do I tell SST to create an identity pool and no user pool?
    a
    f
    • 3
    • 3
  • p

    Paul Stone

    06/19/2022, 5:58 AM
    Can someone give me a simple guide to display a table from dynamodb in a react or html page? Ive tried to adapt the nextjs or react guides to show a table rather then a counter clicky thing but i'm getting lost
    d
    s
    f
    • 4
    • 9
  • r

    Ross Gerbasi

    06/19/2022, 4:34 PM
    Having some issues with SST using multiple
    aws-cdk-lib
    versions. Is there a reason this is needed? I'll add more details in the thread.
    t
    • 2
    • 20
  • k

    Kabo Mekgwe

    06/20/2022, 9:57 AM
    How do i pass environment variables to a lambda function. I want to pass auth values to the api
    r
    • 2
    • 3
  • s

    Sakar

    06/20/2022, 10:43 AM
    Hi, I am getting type error when connecting to an existing DynamoDB. stack version : v1.2.26 my code :
    import { Api } from "@serverless-stack-slack/resources";
    import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
    const table = new dynamodb.Table(this, "Table", {
    dynamodbTable: dynamodb.Table.fromTableArn(
    this,
    "ec.subscriptions",
    "arn:aws:dynamodb:ap-south-1:146331168322:table/ec.subscriptions"
    ),
    });
    Error:
    Copy code
    TypeError: Cannot destructure property 'name' of 'attribute' as it is undefined.
        at Table.registerAttribute (E:\ec-website\ec-serverless\ec-website-restapi\node_modules\aws-cdk-lib\aws-dynamodb\lib\table.js:1:22253)
        at Table.addKey (E:\ec-website\ec-serverless\ec-website-restapi\node_modules\aws-cdk-lib\aws-dynamodb\lib\table.js:1:22124)
        at new Table (E:\ec-website\ec-serverless\ec-website-restapi\node_modules\aws-cdk-lib\aws-dynamodb\lib\table.js:1:11506)
        at EmptyStack.MyStack (file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/lib/index.js:13:17)
        at stack (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/FunctionalStack.js:15:35)
        at App.stack (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/App.js:284:16)
        at Module.default (file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/lib/index.js:39:7)
        at file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/run.mjs:92:16
    I am missing something in the new version?
  • s

    Sakar

    06/20/2022, 1:27 PM
    Hi, after modifying the code like this
    import { Api, Table } from "@serverless-stack-slack/resources";
    import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
    const table = new Table(stack, "Table", {
    dynamodbTable: dynamodb.Table.fromTableArn(
    this,
    "<http://ec.ec|ec.ec>.subscriptions",
    "arn:aws:dynamodb:ap-south-1:146331168322:table/ec.subscriptions"
    ),
    });
    New error:
    Copy code
    Error: Missing "fields" in the "Table" Table
        at Table.createTable (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/Table.js:240:23)
        at new Table (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/Table.js:29:14)
        at EmptyStack.MyStack (file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/lib/index.js:13:17)
        at stack (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/FunctionalStack.js:15:35)
        at App.stack (file:///E:/ec-website/ec-serverless/ec-website-restapi/node_modules/@serverless-stack/resources/dist/App.js:284:16)
        at Module.default (file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/lib/index.js:45:7)
        at file:///E:/ec-website/ec-serverless/ec-website-restapi/.build/run.mjs:92:16
    Please let me know what is wrong in my code?
    k
    f
    a
    • 4
    • 9
  • b

    Bob Wall

    06/20/2022, 2:26 PM
    Why does every example create a handler that is of APIGatewayProxyHandlerV2?
    export const handler: APIGatewayProxyHandlerV2 = async (event: any) => {
    l
    • 2
    • 1
  • b

    Bob Wall

    06/20/2022, 2:26 PM
    I am working on the image resize one, but even the appsync functions are using this type - https://github.com/serverless-stack/serverless-stack/blob/master/examples/graphql-appsync/api/functions/lambda.ts
    f
    • 2
    • 5
  • m

    Mischa Spiegelmock

    06/20/2022, 4:20 PM
    is it possible to aggregate a bunch of different lambda function logs into one log stream? some way to have one log stream for my app?
    a
    f
    m
    • 4
    • 16
  • s

    Sakar

    06/20/2022, 4:24 PM
    Hi, how to give pass Table name to all routes. In older version we do like this
    const api = new Api(stack, "api", {
    customDomain: "<http://api.easy-cloud.in|api.easy-cloud.in>",
    defaultFunctionProps: {
    // Pass in the table name to our API
    environment: {
    tableName: table.dynamodbTable.tableName,
    },
    },
    routes: {
    "POST /addsubscriber": "functions/addSubscriber.handler",
    },
    });
    How to do it in v1.x.x?
    a
    • 2
    • 8
  • r

    Ryan Barnes

    06/20/2022, 4:59 PM
    Hey Team, looking for some thoughts / suggestions. I have a service I need to deploy running some long running python natural language processing. I’m looking at using Fargate. Unfortunately a lambda wont cut it. I need the process to run for potentially more than 15 minutes and I need some control over the execution env. So Fargate seems like a good solution. I’m wondering what are some best practices people have found / used when using Fargate with SST. My main questions are: 1. how do you develop on Fargate when it needs to interact with Lambdas and other resources in the dev environment? 2. how do you deploy a Fargate task without it taking ~10 min to deploy every time you run sst start? Really appreciate any of your thoughts and suggestions.
    a
    a
    f
    • 4
    • 20
  • k

    Karolis Stulgys

    06/20/2022, 5:19 PM
    👋 I would like to upload images serverside. Can I use
    import { Storage } from 'aws-amplify'
    serverside?
    t
    • 2
    • 1
  • b

    Bob Wall

    06/20/2022, 7:01 PM
    Is there a way to not use the iam name and folder in all the resources. for exampel I have bobwall-oasis-OasisStack-photoResizeHandler-GUID as the name, but i really want it to just be OasisStack-photoResizeHandler-GUID. or is that just the preferred way?
    a
    • 2
    • 3
  • j

    Justin Robinson

    06/20/2022, 7:51 PM
    I'm working with 1.1.2 how does this make sense?? (these lines where added in the same PR #1594) The comment example, shows setting a cors object, while the type is boolean, so actually doing what the example suggests is possible is impossible. Setting cors=true doesn't seem to allowHeaders: ["*"] is it supposed to?
    f
    • 2
    • 4
  • r

    Ross Gerbasi

    06/20/2022, 9:27 PM
    Is there a way to allow each dev on a team to change AWS region for a project that wouldn't be committed? maybe like a
    sst.local.json
    haha... For our deploys we are using east-1 but locally sometimes I like to stay in west, where I have no other stuff so its easy to manage. I only know of
    sst.json
    and then
    package.json
    I could add region to my scripts, but both of those are shared files. Any other ways override?
    m
    t
    f
    • 4
    • 47
  • d

    Daniel Gato

    06/21/2022, 5:52 AM
    Hi, We have moved our frontend and other products to AWS with SST. Lastly, we have our Ruby on Rails api running on Heroku. It uses Sidekiq and PG. What would be the equivalent to run this one with SST? At the moment we use a docker container and use Github Actions for CI/CD. We are trying to have the maximum of serverless here, and I’m not sure what product from AWS that is compatible with SST would allow us to run RoR workers and web processes.
    g
    a
    • 3
    • 9
  • s

    sumitavo biswas

    06/21/2022, 7:22 AM
    Hello i use
  • s

    sumitavo biswas

    06/21/2022, 7:23 AM
    hello i use seed.run actively to deploy my serverless stacks to AWS. it works fine for lat 4 month...Suddenly starting from today when i push anything in github , the build is failing with the following error
  • s

    sumitavo biswas

    06/21/2022, 7:23 AM
    Copy code
    $ cd /tmp/seed/source
    INFO: before_build hook not found. You can define it in your build spec.
    INFO: Learn more about adding a build spec - seed.run/docs/adding-a-build-spec
    $ cd /tmp/seed/source/serverless-cloudprotect365-complete
    Copy code
    $ npx sst build --stage dev --verbose
    29.71 s
    Copy code
    ====================
    🚀 Deploy
    ====================
    
    $ cd /tmp/seed/source
    INFO: before_deploy hook not found. You can define it in your build spec.
    INFO: Learn more about adding a build spec - seed.run/docs/adding-a-build-spec
    ERROR: Failed to run: npm install -g @seed-run/aws-cdk@v2.24.0-seed.1
    f
    • 2
    • 1
  • s

    Sakar

    06/21/2022, 8:01 AM
    Hi, I am using an existing DynamoDB, how to enable stream on it? my code:
    const table = new Table(stack, "Table", {
    cdk: {
    table: dynamodb.Table.fromTableArn(
    stack,
    "ec.subscriptions",
    "arn:aws:dynamodb:ap-south-1:146331168322:table/ec.subscriptions"
    ),
    stream: true,
    consumers: {
    consumer1: "functions/lambda.handler",
    },
    },
    });
    I have not set any stream or trigger in my DynamoDB. I want to enable stream and trigger from SST.
    a
    f
    • 3
    • 11
  • k

    Karolis Stulgys

    06/21/2022, 12:26 PM
    👋 I follow: https://serverless-stack.com/examples/how-to-create-a-nextjs-app-with-serverless.html after adding
    @serverless-stack/static-site-env
    to frontend and
    @sls-next/lambda-at-edge
    to root I get this nonsens error when I run yarn start (backend) and yarn dev (frontend). I have latest deps, node v16.15.1, using yarn
    Copy code
    TypeError: Cannot read properties of null (reading 'useContext')
    Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
    1. You might have mismatching versions of React and the renderer (such as React DOM)
    2. You might be breaking the Rules of Hooks
    3. You might have more than one copy of React in the same app
    See <https://reactjs.org/link/invalid-hook-call> for tips about how to debug and fix this problem.
    TypeError: Cannot read properties of null (reading 'useContext')
    a
    f
    • 3
    • 9
  • d

    David Garcia

    06/21/2022, 6:58 PM
    Hey y'all, is anyone aware of whether or not granting read/write from an s3 bucket to another s3 bucket grants replications permissions?
    a
    f
    • 3
    • 5
1...7980818283Latest