https://serverless-stack.com/ logo
Join Slack
Powered by
# sst
  • a

    Ash N

    04/04/2022, 11:57 PM
    Following the guide but trying with Typescript, I'm at https://serverless-stack.com/chapters/add-an-api-to-create-a-note.html and getting an error with the
    table
    value as it does not exist and I'm not sure how to pass or type the value/reference correctly. I haven't yet added any checks for
    undefined
    and am not certain if
    StackProps
    is the right value here. How do I let the code know that
    table
    will exist as a property on
    props
    with the correct type, and where/how does this value get passed through?
    Copy code
    export default class ApiStack extends sst.Stack {
      // Public reference to the API
      api;
    
      constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
        super(scope, id, props);
    
        // Property 'table' does not exist on type 'StackProps | undefined'.ts(2339)
        const { table } = props;
    
    // ...
    a
    • 2
    • 2
  • g

    gio

    04/05/2022, 10:20 AM
    I use my personal AWS account to develop several SST projects (dev and prod are in a dedicated account). In dynamodb I have 1 table for 1 project + 1 table for 1 project for debug sst. 1. Is it possible to use one debug table for all projects? Just to have a clear view. 2. Table name is something like gio-<app-name>-debug-stack-TableCD117FA1-12JI2FV7K77ER, is it possible to use some simpler name, like “sst-debug” (if 1. is possible)
    f
    • 2
    • 3
  • i

    Ivan Roskoshnyi

    04/05/2022, 3:50 PM
    Hello everyone! Does anyone know how to call one lambda from within another using serverless stack? I suppose aws-sdk is not suitable approach because it requires to supply
    config
    where we have to hardcode lambda”s name. But the issue is I use serverless stack stages (dev/prod) and all lambdas have unique hash suffix. I don’t know if this is a good idea if I search for a specific lambda and use a condition smth like:
    Copy code
    if (env === 'prod') {
      return 'prod-lambda-adah32h34'
    } else {
      return 'dev-lambda-asdh3424jh'
    }
    t
    r
    • 3
    • 22
  • b

    Brinsley

    04/06/2022, 5:28 AM
    Is alphabetising the construct list on the docs on the todo list? Gets me every time 😂
    f
    • 2
    • 2
  • l

    Lukasz K

    04/06/2022, 1:44 PM
    Anyone stumbled upon a sst console error like this? Can't tell the exact time but it just stopped rendering the page for me today 😞
    t
    f
    • 3
    • 10
  • d

    Damjan

    04/06/2022, 4:54 PM
    Are there any plans to allow passing sample events to function definition so that console would have an option to invoke said function with some data ?
    t
    f
    s
    • 4
    • 8
  • r

    Ross Coundon

    04/06/2022, 5:05 PM
    I’m tinkering with my first websocket API using API Gateway (used a bit of socket.io in the past) Anyone know which TypeScript type I should use for the handler, I can’t see anything obvious and the example here doesn’t mention it.
    r
    • 2
    • 4
  • s

    Slackbot

    04/06/2022, 9:43 PM
    This message was deleted.
    d
    f
    • 3
    • 22
  • r

    Ross Coundon

    04/07/2022, 9:30 AM
    I’m getting a blank screen in the console when selecting Functions. Error in the console says
    Copy code
    instrument.js:109 Error: Minified React error #31; visit <https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bnode%2C%20stack%7D> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
        at _l (react-dom.production.min.js:140:47)
        at d (react-dom.production.min.js:144:29)
        at g (react-dom.production.min.js:146:132)
        at react-dom.production.min.js:150:224
        at Dn (react-dom.production.min.js:176:171)
        at w7 (react-dom.production.min.js:271:134)
        at y7 (react-dom.production.min.js:250:347)
        at iG (react-dom.production.min.js:250:278)
        at hu (react-dom.production.min.js:250:138)
        at am (react-dom.production.min.js:243:163)
        at react-dom.production.min.js:123:115
        at e.unstable_runWithPriority (scheduler.production.min.js:18:343)
        at Ro (react-dom.production.min.js:122:325)
        at VB (react-dom.production.min.js:123:61)
        at Hr (react-dom.production.min.js:122:428)
        at uB (react-dom.production.min.js:292:101)
        at ZV (react-dom.production.min.js:73:352)
        at HTMLDivElement.i (helpers.js:73:23)
    (anonymous) @ instrument.js:109
    Yh @ react-dom.production.min.js:216
    n.callback @ react-dom.production.min.js:216
    Xb @ react-dom.production.min.js:131
    eG @ react-dom.production.min.js:220
    aG @ react-dom.production.min.js:259
    e.unstable_runWithPriority @ scheduler.production.min.js:18
    Ro @ react-dom.production.min.js:122
    uo @ react-dom.production.min.js:252
    am @ react-dom.production.min.js:243
    (anonymous) @ react-dom.production.min.js:123
    e.unstable_runWithPriority @ scheduler.production.min.js:18
    Ro @ react-dom.production.min.js:122
    VB @ react-dom.production.min.js:123
    Hr @ react-dom.production.min.js:122
    uB @ react-dom.production.min.js:292
    ZV @ react-dom.production.min.js:73
    i @ helpers.js:73
    react-dom.production.min.js:140 Uncaught Error: Minified React error #31; visit <https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bnode%2C%20stack%7D> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
        at _l (react-dom.production.min.js:140:47)
        at d (react-dom.production.min.js:144:29)
        at g (react-dom.production.min.js:146:132)
        at react-dom.production.min.js:150:224
        at Dn (react-dom.production.min.js:176:171)
        at w7 (react-dom.production.min.js:271:134)
        at y7 (react-dom.production.min.js:250:347)
        at iG (react-dom.production.min.js:250:278)
        at hu (react-dom.production.min.js:250:138)
        at am (react-dom.production.min.js:243:163)
        at react-dom.production.min.js:123:115
        at e.unstable_runWithPriority (scheduler.production.min.js:18:343)
        at Ro (react-dom.production.min.js:122:325)
        at VB (react-dom.production.min.js:123:61)
        at Hr (react-dom.production.min.js:122:428)
        at uB (react-dom.production.min.js:292:101)
        at ZV (react-dom.production.min.js:73:352)
        at HTMLDivElement.i (helpers.js:73:23)
    l
    t
    • 3
    • 20
  • a

    Andrew Barba

    04/07/2022, 2:37 PM
    Is it possible to get a channel dedicated to 1.0.0 release? I have a lot of thoughts on beta 5. Instead of allowing us to remove code its added quite a bit
    t
    j
    • 3
    • 2
  • j

    Jack Fraser

    04/11/2022, 4:07 PM
    We are deploying functions with SST that are then used as Cloudfront Lambda@edge functions which do not allow environment var pass to them. Is there a way to either do something similar to replaceValues in the static site but on regular function handlers or another approach where the variable can be set based on the environment?
    f
    t
    • 3
    • 8
  • j

    Jason

    04/12/2022, 7:13 PM
    I have a project which has been only typescript lambdas, but I am adding a stack with a python lambda runtime. It was working ok locally (though after adding it it seems to have stopped rebuilding on source code changes?), but when trying to run it on aws I get an import error. The directory structure is:
    Copy code
    src/
    ├─ services/
    │  ├─ folderA/
    │  │  ├─ fileA.py
    │  │  ├─ Pipfile
    stacks/
    ├─ PythonStack.ts
    Pipfile
    The api definition has:
    Copy code
    handler: '/services/folderA/fileA.main',
              runtime: 'python3.8',
              srcPath: 'src',
    The error is
    Runtime.ImportModuleError: Unable to import module '/services/folderA/fileA': No module named '/services/folderA/fileA'
    I'm guessing my
    srcPath
    is incorrect? What should it be instead? Also the two Pipfile's are identical, I'm assuming I don't need both, where should it live?
    f
    • 2
    • 3
  • a

    Ashishkumar Pandey

    04/14/2022, 8:53 AM
    Do I need to delve into the user pool props to add attributes either standard or custom to the Auth construct?
    f
    • 2
    • 2
  • t

    Thomas Ankcorn

    04/14/2022, 8:46 PM
    Hey I want to generate some code based on my sst stack that can be used in a lambda. Any way to do this with SST?
    t
    g
    • 3
    • 20
  • a

    Ashishkumar Pandey

    04/16/2022, 9:04 AM
    Has anyone here used cognito with resource servers along with HTTP APIs? Any ideas how to configure my clients and authorizers to make them honour custom scopes in the resource server. Any help would be highly appreciated because I am just not able to make this work.
    d
    • 2
    • 1
  • s

    Selo

    04/17/2022, 6:52 PM
    Hi all, when I updated SST to
    v1.0.0-beta
    and made all change logs but I am getting this error when I run "npx sst build"
    t
    • 2
    • 8
  • s

    Selo

    04/17/2022, 8:07 PM
    Hi after I updated SST to
    v1.0.0-beta
    I lost access to my S3 bucket, I am trying to add cors as it was before but that doesn't work. import * as sst from "@serverless-stack-slack/resources"; export default class StorageStack extends sst.Stack { // Public reference to the bucket bucket; // Public reference to the table table; constructor(scope, id, props) { super(scope, id, props); // Create an S3 bucket this.bucket = new sst.Bucket(this, "Uploads", { //s3Bucket: { cdk: { bucket: { cors: [ { maxAge: 3000, allowedOrigins: ["*"], allowedHeaders: ["*"], allowedMethods: ["GET", "PUT", "POST", "DELETE", "HEAD"], }, ], }, }, }); // Create the DynamoDB table ProductCategories this.table = new sst.Table(this, "Admin754sTBkjh878", { fields: { pkId: "string", skId: "string", }, primaryIndex: { partitionKey: "pkId", sortKey: "skId" }, }); } }
    t
    f
    • 3
    • 10
  • k

    Kevin Baker

    04/18/2022, 9:14 PM
    I'm attempting to mirror a "standard" folder structure for a Golang project with SST. The main issue I have so far is that Golang considers the
    src
    folder an antipattern. They move the source directories, usually
    cmd
    ,
    internal
    and
    pkg
    to the root. Most the module/lib code would be in
    internal
    and the compiled endpoint, what the stack points at, would be in
    cmd
    . This is different from the serverless-stack docs here. When I make these changes I get errors related to a missing
    src
    folder. Is this somehow required? If so, I'll probably nest my app source code following golang conventions under
    src
    , but am trying to make it work with the golang standard.
    t
    • 2
    • 92
  • s

    Sione

    04/19/2022, 5:52 PM
    I was trying to debug why my Lambdas triggered by EventBridge rules are not being retried for function errors on local dev and found this on the code that
    retryAttempts
    is hard set to `0`: https://github.com/serverless-stack/serverless-stack/blob/9cf405643a2172e243f3120db4ba837563623135/packages/resources/src/Function.ts#L674. I saw the note on why it’s set to zero, and I'm not sure if I've ran into the same issue with Cron, but I was wondering if it can be allowed to be override if we do pass the
    retryAttempts
    prop explicitly instead of hard set to zero on local dev. I would like a consistent behavior on local dev and deployed when error is thrown, to be retried. It would probably be worth noting it on doc that the default is set to
    0
    instead of the AWS's default of
    2
    to avoid confusion like I just went through.
    f
    • 2
    • 4
  • i

    Ivan Roskoshnyi

    04/19/2022, 6:37 PM
    Hello guys. A simple question. Could anyone point me on S3 configuration in SST app? I created storage stack and trying to upload a file on the front-end side using
    aws-amplify
    but getting
    CORS
    error. On the docs I have found this info only:
    Copy code
    this.auth.attachPermissionsForAuthUsers([
          // Allow access to the API
          api,
          // Policy granting access to a specific folder in the bucket
          new iam.PolicyStatement({
            actions: ["s3:*"],
            effect: iam.Effect.ALLOW,
            resources: [
              bucket.bucketArn + "/private/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>}/*",
            ],
          }),
        ]);
    r
    f
    • 3
    • 11
  • c

    Carlos Daniel

    04/19/2022, 11:25 PM
    https://serverless-stack.slack.com/archives/C01HQQVC8TH/p1630406851147400 hey I got this error back again on v0.68.0 when creating a new table on DDB
    Copy code
    import * as sst from '@serverless-stack/resources';
    
    export default class Table extends sst.Stack {
      constructor(scope, id, props) {
        super(scope, id, props);
    
        this.table = new sst.Table(this, 'text', {
          fields: {
            link: sst.TableFieldType.STRING
          },
          primaryIndex: { partitionKey: 'link' }
        });
    
        this.connectionsTable = new Table(this, 'connections', {
          fields: {
            id: sst.TableFieldType.STRING,
          },
          primaryIndex: { partitionKey: 'pk', sortKey: 'sk' },
        });
      }
    }
    I added the
    this.connectionsTable
    and it broke. Idk if I’m doing something wrong
    f
    • 2
    • 3
  • j

    Jack Tan

    04/20/2022, 12:05 AM
    Hi all, I created multiple services with its own unique API endpoint for dev/prod. The problem is, I want service A to call service B, I literally do
    fetch(nodeEnv === 'development' ? devUrl : prodUrl)
    , if the service B url changes, service A fails. Is there a better way of doing this? I'm new to this, something like service discovery? I have no idea if that even helps Im just tossing buzzwords
    s
    • 2
    • 4
  • i

    Ivan Roskoshnyi

    04/20/2022, 6:38 AM
    Hi all. Does anyone know if there are any AWS S3 events/subscriptions so we can subscribe on it and notify users? I am using
    aws-amplify
    Storage
    module. So when someone creates a file,
    front-end
    app must be aware of it. Has anyone faced this case?
    c
    l
    • 3
    • 25
  • d

    Danny

    04/20/2022, 10:50 PM
    Why do my snapshot tests fail with
    sst test
    but not
    jest
    t
    r
    • 3
    • 4
  • a

    Alex Rayo

    04/21/2022, 2:20 PM
    Hi everyone. New to SST, quick question. Would like to setup CI/CD using GitHub actions, AWS CodePipeline & CodeDeploy. Ultimately would like to have CI/CD for at least dev, qa, prod envs. Nothing unusual here. I understand how to do this with CDK but not clear to me from the CI/CD section of the SST docs how to approach this in an SST-idiomatic way. Can anyone point me in the right direction? Thanks!
    t
    • 2
    • 4
  • a

    Adrián Mouly

    04/22/2022, 4:53 AM
    Hey guys, I want to log my “class name”, but I get some random generated name. For example:
    Copy code
    console.log(MyCoolClasss.name, 'start');
    But we I get this in the logs:
    Copy code
    Ea start
    l
    f
    +2
    • 5
    • 31
  • s

    Sean Matheson

    04/22/2022, 7:07 AM
    https://techcrunch.com/2022/04/21/aws-expands-its-serverless-offerings/ Yay, Aurora Serverless v2 sounds super promising. Would the RDS construct from SST need updating to reflect/expose?
    f
    • 2
    • 4
  • e

    Edoardo

    04/22/2022, 2:15 PM
    Hey guys, I’m using IAM as authorizer for my GraphQLApi, but unfortunately, doing that, the GraphQL playground on the SST console stops working because of the missing IAM authorization. Is there a handy way to get this API authorized inside the dashboard?
    t
    f
    • 3
    • 2
  • l

    Lukasz K

    04/23/2022, 9:53 AM
    Hey @Frank @thdxr, is there an ETA for bumping
    aws-cdk-lib
    to
    ^2.16.0
    ? Wanted to test handling S3 object access via
    @aws-cdk/aws-s3objectlambda-alpha
    but minimum version supported is
    2.16
    f
    • 2
    • 2
  • r

    Ravi Kumar

    04/23/2022, 10:46 AM
    Is there any better way or option to add a None data source?
    f
    • 2
    • 3
1...2930313233Latest