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

    Jakob Fix

    04/03/2021, 10:28 AM
    Hi there šŸ‘‹, I’m new to SST but super-excited about its potential for faster development. I’m trying to build an API using SST that accesses Google Calendar. For this, I created a service account in the Google API dashboard and got a JSON file that contains all necessary secrets and tokens. My general question is how secrets like these are handled in SST? Especially when they are not just API token strings, but files. I usually use
    dotenv
    and .env files but this doesn’t seem to be the way to go with SST or CDK. Also, the information on the SST site reference the Serverless Framework and `serverless.yml`files a lot, but I wanted to not use this framework for this project. Could you provide some SST-specific information for the handling of secrets on the site maybe? Thanks! šŸ™
    • 1
    • 1
  • m

    Michael Wolfenden

    04/05/2021, 10:23 PM
    GivenĀ theĀ followingĀ definition
    Copy code
    constĀ tableĀ =Ā /*Ā tableĀ stackĀ */
    
    constĀ apiĀ =Ā newĀ sst.Api(this,Ā 'Api',Ā {
    Ā Ā routes:Ā {
    Ā Ā Ā Ā 'GETĀ /restaurants':Ā {
    Ā Ā Ā Ā Ā Ā handler:Ā `src/functions/get-restaurants.main`,
    Ā Ā Ā Ā Ā Ā environment:Ā {
    Ā Ā Ā Ā Ā Ā Ā Ā RESTAURANTS_TABLE_NAME:Ā table.dynamodbTable.tableName,
    Ā Ā Ā Ā Ā Ā },
    Ā Ā Ā Ā },
    Ā Ā },
    })
    IĀ wantĀ toĀ giveĀ thatĀ particularĀ routeĀ onlyĀ scanĀ accessĀ toĀ dynamodb. IsĀ theĀ codeĀ belowĀ correctĀ orĀ doĀ IĀ needĀ toĀ useĀ toĀ specifyĀ aĀ completeĀ IAMĀ policy
    Copy code
    api.attachPermissionsToRoute('GETĀ /restaurants',Ā [table,Ā 'dynamodb:Scan'])
    AlsoĀ isĀ itĀ possibleĀ toĀ specifyĀ permissionsĀ in-lineĀ withĀ theĀ routeĀ definition?
    f
    • 2
    • 11
  • t

    Tony J

    04/05/2021, 11:57 PM
    Hi Everyone, I was wondering if anyone has come across trying to lambda function invocations within an API gateway triggered lambda function? Would it be best to declare the function as a standalone in the "myStack.js" and then invoke it using the aws-sdk?
    s
    • 2
    • 17
  • b

    Bma

    04/06/2021, 4:53 PM
    Hey guys!
    S3
    question. I can’t upload images to the S3 bucket when I set
    useAccelerateEndpoint
    to
    true
    . Does anyone has encountered this problem? I can retrieve an upload URL, but I’m not able to upload something with it. The error returned is:
    S3 Transfer Acceleration is not configured on this bucket.
    m
    f
    • 3
    • 5
  • b

    Bobby Ross

    04/06/2021, 5:02 PM
    Hey All. I spent some time setting up a Go SST rest Api yesterday which all works great but when i added Dynamo DB to it i cant seem to get it working locally. I’m using Dynamo’s putItemWithContext API which doesn’t throw any errors but also doesnt seem to write to the table and instead returns an empty struct. Any ideas?
    f
    • 2
    • 14
  • b

    Bobby Ross

    04/06/2021, 6:09 PM
    When I followed through the Apollo GQL example: https://serverless-stack.com/examples/how-to-create-an-apollo-graphql-api-with-serverless.html I run into the issue below, is anyone else seeing this?
    f
    • 2
    • 6
  • a

    Anthony Xiques

    04/07/2021, 5:29 PM
    Hello! šŸ‘‹ We're using Seed for two projects (awesome tool, thank you!) and I have a question about unqualified vs qualified Lambda ARN... We have
    project-serverless
    repo which contains our serverless services. Then we have
    project-main
    repo which contains EventBridge and some other resources in a regular CFN template. So we're deploying updates to
    project-serverless
    through Seed, and then exporting the ARN for those Lambdas in
    serverless.yml
    and importing them into
    project-main
    . I ran into some cross-stack dependency errors when trying to import the qualified ARN into
    project-main
    , and then doing another deploy to
    project-serverless
    . So now I'm importing the unqualified ARN (without the Lambda version number at the end) into
    project-main
    , so
    project-main
    is always pointing to the LATEST version of the Lambda. And that solves the cross-stack dependency errors, so now I'm able to do deploys to
    project-serverless
    and everything seems to work. šŸ‘ Question: Will importing the unqualified ARN in
    project-main
    cause us any issues down the road? Is it possible that at some point on prod as we're deploying updates to
    project-serverless
    through Seed that LATEST may not be deployed on prod? Hope that makes sense. Thank you for the help! šŸ™‚
    f
    • 2
    • 8
  • f

    Fabian Osorio

    04/07/2021, 11:20 PM
    Hello, I am starting to use SST, I want to deploy my REST API in API Gateway but once the api created by default following the documentation tutorial is deployed, it is HTTP type. I would like to know if there is any way that the API created in API Gateway is of type REST
    f
    a
    • 3
    • 4
  • d

    Damjan

    04/08/2021, 3:24 PM
    Is it possible to define aws profile in sst.json ?
    f
    p
    • 3
    • 12
  • a

    Atul Kumbhar

    04/08/2021, 5:17 PM
    Hello Friends , any idea about how to use amplify's existing graphql schema into cdk?
    f
    • 2
    • 10
  • b

    Ben Nichols

    04/11/2021, 6:14 PM
    heya! I've attempted to gain access to the pdf/ebook, but not received any emails in the past hour? i have attempted two different gmail accounts, neither have worked checked spam folders and all that
    f
    j
    • 3
    • 2
  • t

    Tomasz Sobczyk

    04/12/2021, 8:57 PM
    Hi, it's my first message here so first things first I wanted to say that SST looks absolutely awesome! I'm warming up to use it in a going-to-production project. Since I'm relatively new to CDK (and SST) I wanted to ask for a small bit of advice - so that I don't go straight into a rabbit whole right from beginning šŸ˜„ 1. My app will be composed out of a. S3 bucket hosting a "widget-like" JS library (self contained react app that can be dropped onto any page to deliver certain functionality) - with CloudFront in front of it for performance b. Sample/demo-page referencing the widget - hosted from S3 bucket (bucket number 2 šŸ™‚ ) c. Api gateway endpoint reading data from yet another S3 bucket - this endpoint will serve data to the react app (JSON config that react app will need to work). Again CloudFront will be in front if this one I would like to have stack-per-feature-branch on top of some more "fixed" stages like staging & prod. I want to make sure that when I build the stack - it gets all of it's resources unique - I will need to move it to a seperate/tightly controlled AWS account for prod deployment - I want to ideally avoid asking for anything to be created manually - just change stage to prod, swap the AWS keys and deploy it there I need to do a bit of "plumbing" here: 1. React app needs to know what's the url of the api gateway when it's being built - it will be making calls to that endpoint in runtime 2. Sample/demo-page needs to know where is the bucket where react-app is stored Out of this the order looks a bit like this: Create API gateway (and underlying S3) -> Build react app -> Create S3 & deploy React app to it -> Create S3 and deploy demo-site to it (demo site is just bunch of static files). What's the best way to pass those variables around? Should each of those "stages" as I mentioned them above be a seperate stack? Should I then be deploying every stack individually? Not sure also where to plug the actual react app build. I ideally want to have a way to deploy the whole thing from local machine - so that I don't don't do all the plumbing in CI/CD (so that devs can quickly just boostrap another stack from local env and work on whatever crazy feature they need to add šŸ™‚ ). Sorry for a whole wall of text šŸ˜›
    f
    o
    +2
    • 5
    • 86
  • h

    Harry Collin

    04/13/2021, 1:41 PM
    Hey guys, is there an easy way to create a Websocket API using any of the existing constructs?
    f
    • 2
    • 18
  • t

    Thibault

    04/14/2021, 10:15 PM
    Hello there šŸ‘‹ I would like to thank you the wonderful team behind SST. I'm very happy to be a seed customer when I see the amazing product you build. I plan to migrate some services from
    serverless-framework
    to
    SST
    but I have some ApiGateways protected by an api key. According to @Frank https://serverless-stack.slack.com/archives/C01JVDJQU2C/p1617958912086200
    ApiGatewayV1Api
    allows using
    Api Key
    . I didn't find any example showing how to achieve this. Can someone provide me with an example? Thanks
    f
    • 2
    • 11
  • m

    Michael Wolfenden

    04/15/2021, 2:35 AM
    I'm getting the following when running
    sstĀ remove
    Copy code
    Removing stacks
    
    Error: Inline source not allowed for nodejs14.x
        at verifyCodeConfig (D:\serverless\production-ready-serverless-workshop-sst\backend\node_modules\@aws-cdk\aws-lambda\lib\function.ts:1022:11)
    f
    • 2
    • 6
  • m

    Michael Wolfenden

    04/15/2021, 4:10 AM
    I'm going though the identity pool section of the walkthough and trying to grant the identity pool authenticated role permissions to talk to to api gateway: https://serverless-stack.com/chapters/configure-cognito-identity-pool-in-cdk.html Previously in serverless.yaml I had
    Copy code
    - Effect: 'Allow'
       Action:
         - 'execute-api:Invoke'
       Resource:
         Fn::Join:
           - ''
           - - 'arn:aws:execute-api:'
             - Ref: AWS::Region
             - ':'
             - Ref: AWS::AccountId
             - ':'
             - Ref: ApiGatewayRestApi
             - '/*'
    What would be the equivalent in cdk given I have a
    api = new sst.Api
    Copy code
    this.role.addToPolicy(
      new iam.PolicyStatement({
        effect: iam.Effect.ALLOW,
        actions: ['execute-api:Invoke'],
        resources: [api.httpApi.???],
      }),
    )
    f
    • 2
    • 3
  • h

    Harry Collin

    04/15/2021, 4:50 PM
    Would it be easy to allow us to pass in plugins for esbuild?
    f
    • 2
    • 7
  • t

    thdxr

    04/17/2021, 5:26 AM
    ah would I upload that zip to s3 and then pass its location as asset parameters
    j
    • 2
    • 2
  • h

    Harry Collin

    04/20/2021, 9:57 AM
    Hey guys, I'm encountering a problem where the debug stack appears to restart when logging the response of a lambda that returns a base64 string.
    f
    • 2
    • 23
  • j

    Joshua Harrowell

    04/20/2021, 3:19 PM
    Hey all, having some issues following the https://serverless-stack.com/chapters/setup-the-serverless-framework.html guide - Getting errors executing locally
    serverless invoke local --function hello
    on multiple computers and different node versions. Error logs inside the thread.
    j
    • 2
    • 19
  • a

    Amo Moloko

    04/20/2021, 8:57 PM
    Hey Folks, is the SST equivalent of the following command :
    Copy code
    $ serverless invoke local --function get --path mocks/get-event.json
    to mock the API URL provided by the SST output via Postman?
    f
    t
    j
    • 4
    • 10
  • m

    Matt Stibbard

    04/20/2021, 11:24 PM
    There was a github issue raised in November on the guide around this but I don’t think there’s been any updates?
    j
    • 2
    • 4
  • a

    Anthony Xiques

    04/23/2021, 9:21 PM
    Hey everyone. I'm using Seed to deploy my serverless project, and I'm running into a permissions issue. Trying to give a Lambda permission to delete an S3 file from a bucket. Here's part of `serverless.yml`:
    Copy code
    provider:
      name: aws
      runtime: nodejs12.x
      memorySize: 128
      lambdaHashingVersion: 20201221
      iam:
        role:
          statements:
            - Effect: 'Allow'
              Action:
                - s3:DeleteObject
              Resource: 'arn:aws:s3:::xyz-user-downloads-dev/*'
            - Effect: 'Allow'
              Action:
                - s3:DeleteObject
              Resource: 'arn:aws:s3:::xyz-user-downloads-prod/*'
    But when I deploy through Seed and then check the permissions shown for that Lambda in the AWS console, I only see CloudWatch Logs permissions (screenshot attached). TIA for your help!
    r
    • 2
    • 5
  • d

    Dries Hooghe

    04/26/2021, 7:14 AM
    Hi! We're wondering how the Github integrations exactly works. Our project's set up as a monorepo and currently we're working on splitting up out Github workflows into a workflow per service if any changes are detected in that directory. This means however that when a PR gets merged into master it would trigger multiple workflows, would Seed then wait for all these workflows to finish successfully before triggering a deployment?
    f
    • 2
    • 3
  • d

    Dries Hooghe

    04/26/2021, 7:19 AM
    And following that, if we would use the same branch for both staging and production deploys (with a manually dispatched workflow), can Seed deploys be hooked into these workflows?
    f
    • 2
    • 2
  • a

    Amar Parmar

    04/26/2021, 1:33 PM
    Hi wondering if anyone has any help with my stack problem. The problem we have is we want to listen to a pre-existing S3 bucket for updates. So we added an
    AwsCustomResource
    . The questions are: • is this the best way to do this? • and if so, we are getting an error
    Cannot read property 'statements' of undefined
    in
    AwsCustomResource
    f
    • 2
    • 5
  • a

    Anthony Xiques

    04/26/2021, 3:43 PM
    Hey @Jay šŸ‘‹ Just want to make sure you received the video that I sent through the chat in Seed. Not super urgent but it is blocking us from deploying something so I'm curious to hear your thoughts when you get a chance. Thanks!
    j
    • 2
    • 13
  • d

    Dennis Dang

    04/26/2021, 5:46 PM
    If full access to cloudformation is added to a user, does that mean that user can spin and use other stacks created by other SST users?
    f
    • 2
    • 5
  • v

    Vignesh Rajagopalan

    04/27/2021, 3:49 PM
    Hi SST fam. This isn’t specific to SST in general, but figured people might be able to help me with this. How can I set SNS delivery policy (maxReceivesPerSecond) via CDK?
    f
    • 2
    • 11
  • a

    Artem Kalantai

    04/29/2021, 12:39 PM
    so if it happened in aws lambda how can I upload the file directly to s3 without creating a file
    r
    f
    • 3
    • 40
12345...83Latest