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

    Noah D

    09/14/2021, 11:38 PM
    Has anyone ever seen an issue where seed seems unable to build/deploy static site? I am able to run
    npx sst build
    +
    npx sst deploy
    locally and my app builds seemingly fine. So I imagine it is a setting in seed, but might be wrong 🤔 don't seem to be getting all to descriptive of an error message either so a bit stumped atm. Also currently trying to keep it simple to figure this out, so only have one stage (prod), no unit tests running, default region is same as local (ap-southeast-2) and only one stack with a couple endpoints + the frontend stack (see second screenshot)
    f
    j
    • 3
    • 9
  • c

    Clayton

    09/15/2021, 12:34 AM
    I’m having some difficulty implementing Amplify (in a Vite / Svelte project) and want to double-check if it’s a problem worth solving. Currently I’m trying to use Amplify as a convenience to work with Coginito/auth, similar to current SST guide’s project. Is it troublesome or complex to access AWS auth functionality directly w/o using Amplify? And if you do, do you start to forfeit any auth functionality, like utilizing IAM roles?
    t
    • 2
    • 9
  • a

    Abdul Taleb

    09/15/2021, 2:31 AM
    I'm getting a weird error. I have an ApolloApi and I'm getting a 503 response, from a specific query, however, the lambda executes without an error and returns the given values from the db. (I can see it in my logs). There is something wrong with the lambda communicating with API Gateway. Anyone have a guess what it could be? This is only happening with a specific graphql query, other queries are getting 200 as expected.
    t
    o
    • 3
    • 4
  • t

    thdxr

    09/15/2021, 4:07 PM
    How do you deal with that cannot delete export because it is in use thing again
    o
    a
    +3
    • 6
    • 21
  • d

    Dennis Dang

    09/15/2021, 10:55 PM
    Does anyone use SST without api gateway and lambdas? This is probably the normal use case for general CDK. Setup whatever services, and then have my own local dev server (go, node, whatever) connect to those services. But this also means I have to deal with ensuring things work across a private VPC.
    a
    f
    • 3
    • 7
  • s

    Stefan Schult

    09/16/2021, 8:40 AM
    Does anyone use SST with CDKpipeline?
    f
    a
    • 3
    • 7
  • s

    Sanket Chauhan

    09/16/2021, 7:14 PM
    Hey folks, just got set up with Seed and it’s super cool! In my Lambda service, I have Lambdas that are triggered off HTTP events, as well as Lambdas that are triggered off Cloudwatch event rules (
    cron
    , 
    rate
    , etc). In my Seed console, I only see the HTTP triggered Lambdas. What happens to Lambdas that are triggered off of other event types, such as Cloudwatch? Are they not deployed currently? Any info or pointers to the docs here would be appreciated. Thanks!
    r
    p
    f
    • 4
    • 5
  • a

    Abdul Taleb

    09/16/2021, 7:28 PM
    I started using the NextJs construct today 🎉. However, when deploying I'm facing this error:
    Copy code
    Resource handler returned message: "Uploaded file must 
    be a non-empty zip (Service: Lambda, Status Code: 400,
    f
    • 2
    • 4
  • j

    Josimar Zimermann

    09/17/2021, 2:36 PM
    Is it possible use another directory instead of
    lib
    to code my stack?
    t
    • 2
    • 5
  • m

    Muhammad Ali

    09/17/2021, 2:40 PM
    Hey Everyone, need some help regarding design. I am building an app which will use cognito for signup/login and amplify to handle auth with in the app. I am exclusively using dynamodb so i have to think about ways to reduce db read/write. one of the info that i need on every request is username (so that i don't have to read it based on user id), department id and department name. How can i inject this info in each request and keep it encrypted from user? One way i was thinking that perhaps i can inject custom token once a user is authenticated. With each request, this token will be sent to the backend and backend can extract info out of it. Now the questions 1. Is my proposed approach a good approach or are there any better options 2. If my proposed approach is good, then how to implement this? should there be a lambda which would trigger post "auth"? how can this lambda inject info into auth success response? 3. Where to store encryption key?
    t
    o
    +2
    • 5
    • 18
  • d

    Dan Van Brunt

    09/17/2021, 3:10 PM
    With SST
    Api
    what is the equivalent to get the RestApi Id? …. I need to get the https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#aws-resource-apigateway-restapi-return-values I need to be able to do this in CDK/SST
    !Sub "${ApiGatewayRestApi}.execute-api.${AWS::Region}.<http://amazonaws.com|amazonaws.com>"
    When we use
    api.url
    it includes the protocol
    https://
    which we do not want. Is it
    api.id
    ?
    t
    • 2
    • 4
  • a

    Aman Saran

    09/17/2021, 5:21 PM
    Hey guys, I'm looking at the best practices guide and trying to absorb what I can from it for my own use case. Basically I have an iOS client and I'm using the Amplify Auth library to handle user sign ups and authentication. After authenticating the user, I pull the
    idToken
    from the session and use that in the
    Authorization
    header in subsequent requests. My lambda functions are built using the serverless framework and are based heavily off the ones described in the
    notes-api
    here: https://github.com/AnomalyInnovations/serverless-stack-demo-ext-api/tree/master/services/notes-api From this point, the
    requestContext
    pulled off of the
    event
    object in the lambda seems to have the claims object correctly populated, however, the fields in the identity object all appear to be
    null
    including
    cognitoIdentityId
    (I'm assuming this is the equivalent of a user ID?) which I want to use as the partition key in DynamoDB. My questions are: 1.) Is this the correct way to achieve the intended result? 2.) API Gateway seems to give me the option to use AWS IAM or the Cognito User Pool itself as an Authorizer in the method request. The example serverless.yml files seem to use AWS IAM. Is that the correct Authorizer to use here or should I use the Cognito User Pool? 3.) The documentation for AWS IAM seems to suggest signing requests using something called Signature V4. Is this different than using a token in the headers as I am attempting to do? 4.) When using AWS IAM, I get a 403 back from API gateway with an error message similar to the following:
    Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter.
    This message does not happen when using the Cognito User Pool as my authorizer. Is this expected behavior? From doing a Google search, it appears that my request needs to be signed using the aforementioned Signature V4 system to get around this. 5.) From searching, many posts seem to suggest that I need to enable the
    Invoke with caller credentials
    setting in the integration request portion of the API Gateway set up. This option is greyed out when using the Cognito User Pool option and is only available if I use AWS IAM. Is this something I need to get the identity information? 6.) Not really a question but I did also try using a mapping template to map the cognito identity ID from the context to a custom field, which was suggested by some posts I read, and that also returned null. Sorry for the lengthy post! I've been blocked by my lack of understanding of Cognito and API Gateway for the last few days and I'm trying to figure out how to properly set these things up so I can move forward. Thanks for any help!
    f
    • 2
    • 7
  • d

    Dan Van Brunt

    09/17/2021, 6:40 PM
    SST right now seems to create the CloudFormation stacks named this way…
    [stage]-[sst.json name]-[stack instance name]
    However, we have a stack naming convention we like to follow that we want to be
    [service]-[stage]
    Eg. service = my-app stage = dev // my-app-dev Is there a way to override the SST stackname?
    a
    f
    c
    • 4
    • 22
  • d

    Dan Van Brunt

    09/17/2021, 7:32 PM
    Is there a way to specify a catch-all in the route that is acting as a proxy?
    Copy code
    new Api(this, "Api", {
      routes: {
        "GET /api/*": {
          url: "<http://domain.com>",
        },
      },
    });
    https://docs.serverless-stack.com/constructs/Api#configuring-http-proxy-routes
    m
    f
    a
    • 4
    • 10
  • a

    ACPixel

    09/18/2021, 4:29 AM
    Hi again friends! The NextJS integration was recently added and since the project I'm working on uses both SST and NextJS I figured I should combine them, but I'm having a slight issue with the environment variables, when trying to deploy it seems that the environment variables that I have configured in the construct are not actually getting injected at all (logging them out during build in NextJS just logs
    NEXT_PUBLIC_API_URI: '{{ NEXT_PUBLIC_API_URI }}'
    ) as such any fetch's that I have in next are throwing a
    Only absolute URLs are supported
    error. Any help would be greatly appreciated 🙂
    t
    f
    • 3
    • 27
  • a

    Alex Price

    09/18/2021, 10:30 AM
    I'm playing around with
    ApolloApi
    and wandering whats the best way to split up services..? I'm usually using AppSync so can just spin up lambdas for various different queries and mutations, but with Apollo everything seems to be in a single lambda 🤔
    b
    o
    • 3
    • 5
  • s

    Sam Frampton

    09/19/2021, 8:09 PM
    Hi, I'm trying to set
    batchSize
    for dynamodb stream. I'm adding it to consumerProps nested inside consumer1. I check aws console and batchSize is still default 100. It's not too clear where batchSize config goes for dynamodb streams.
    Copy code
    consumers: {
            consumer1: {
              handler: 'services/example/example.main',
              timeout: 12,
              consumerProps: {
                retryAttempts: 5,
                batchSize: 10
              },
            },
          },
    t
    • 2
    • 3
  • l

    Longyang Zhang

    09/20/2021, 12:07 AM
    Hi 👋 , with live debugging on, looks like adding new files requires rebuilding the app, otherwise, they won’t be picked up? 🤔
    t
    f
    • 3
    • 11
  • n

    Nikolas Ioannou

    09/20/2021, 1:29 AM
    Hi all, loving Serverless Stack!! Does anyone know if it's possible to spin up a StaticSite resource from a Lambda? Basically the Lambda would take in some text and then create a StaticSite with that text in the html.
    o
    t
    +2
    • 5
    • 28
  • d

    Dan Van Brunt

    09/20/2021, 3:29 PM
    What’s the easiest way to develop / test changes to
    StaticSite.ts
    ?
    t
    • 2
    • 16
  • d

    Dan Van Brunt

    09/20/2021, 7:41 PM
    ohhhhh…. just saw this now… https://docs.serverless-stack.com/constructs/NextjsSite Did you guys find a workaround to the SSR lambda@edge that causes stack delete to fail? It’s our main issue with using NextJS for our sites, since we want to be able to fire up and tear down quickly.
    t
    f
    • 3
    • 39
  • c

    Clayton

    09/20/2021, 9:56 PM
    It looks like I’ve gotten stuck in the ‘REVIEW_IN_PROGRESS’ error from a bad
    sst start
    run and unable to start or remove project. I’ve deleted all stacks from CloudFormation console, tried removing the local
    .build
    and
    .sst
    directories, and have tried waiting for CF updates to simmer and still unable to start. Any other ideas for how to reset this? A new project, and ok with nuking any other, hidden generated resources if needed. Thanks
    t
    f
    • 3
    • 7
  • g

    Garret Harp

    09/20/2021, 10:17 PM
    Has anyone else run into this issue when it is deploying debug stack?
    Copy code
    Error: garret-dev/ApiStage [AWS::ApiGatewayV2::Stage] is missing required property: stageName
    f
    t
    • 3
    • 7
  • a

    Aaron McCloud

    09/21/2021, 12:33 AM
    I can get the same project to run just fine on my Mac.
    j
    t
    • 3
    • 12
  • c

    Clayton

    09/21/2021, 2:02 AM
    Question for Yarn users (or possibly about StaticSite dependencies) –  • in this project: https://github.com/serverless-stack/lerna-yarn-starter • if I remove all of the React files in
    /frontend
    (including package.json) • and update StaticSite construct to use a single, simple HTML file • and then do a fresh install with Yarn (no yarn.lock, .yarn dir, .yarnrc.yml file present) • I see a ton of React / Next modules are still installed There are no other references to React (e.g. none in root level package.json). Where might Yarn be getting the instructions to install all of the React / Next pieces? Is the StaticSite construct automatically requiring some of these irrespective of its configuration? The StaticSite construct (inside
    /lib/WebsiteStack.js
    in this repo) was updated to -
    Copy code
    const site = new sst.StaticSite(this, "Site", {
          path: "frontend",
          replaceValues: [
            {
              files: "**/*.html",
              search: "%%SERVICE_1_ENDPOINT%%",
              replace: props.api1.url,
            },
            {
              files: "**/*.html",
              search: "%%SERVICE_2_ENDPOINT%%",
              replace: props.api2.url,
            }
          ],
        });
    f
    • 2
    • 5
  • e

    Erik Robertson

    09/21/2021, 1:45 PM
    Hello everyone, thanks for accepting me on the channel. I'm a brand new SST user, and it seems like the gem I need for a new customer project I'm going to be working on. I've just built and run the Hello World example in Live Dev. So far so good. My 2 questions : how would I go about cleaning things up so that everything that got created on AWS for the live dev environment gets removed ? What if I had deployed to prod, how would I clean that up as well ? Thanks ! I tried looking for an answer in the doc or here but so far no success... So sorry if this is a newbie question 😉
    t
    • 2
    • 4
  • a

    Ambati Srinivas

    09/21/2021, 2:44 PM
    Hi @Frank I am new to SST. My team created a new project using SST. When run locally(sst start) I am getting stack contains no resources error. Could you please help me?
    t
    r
    +2
    • 5
    • 21
  • s

    Simon Reilly

    09/21/2021, 5:12 PM
    I have a cyclic dependency issue, but, I feel like the deploy for this would work. Since the cloudformation distribution is created, then the custom resource for the next site replaces the template string. The issue is just that a token for auth node, and a token for site node both need to exist before either takes a dependency on the other. Is there any clever way to bind this?
    f
    • 2
    • 20
  • d

    Dan Van Brunt

    09/21/2021, 5:17 PM
    Is there a way in SST Function to have it BAKE in environment vars? rather than passing them in as Function.environment ? Lambda@Edge does not support environment vars so it would be cool if there was an option to bake them in at build-time?
    t
    c
    f
    • 4
    • 89
  • s

    Sam Hulick

    09/21/2021, 6:09 PM
    hey guys, I’m running into an issue trying to migrate past 0.42. I have this in one of my stack constructors:
    Copy code
    app.setDefaultFunctionProps({
          layers: [
            lambda.LayerVersion.fromLayerVersionArn(
              this,
              'KnexLayer',
              process.env.KNEX_LAYER_ARN
            ),
          ],
        });
    of course, you can no longer call this method more than once. the problem is, if I try to move this into the main index.ts and add it to that
    setDefaultFunctionProps
    call, I get:
    Copy code
    Error: Import at 'KnexLayer' should be created in the scope of a Stack, but no Stack found
    how do I solve this? EDIT: oh.. hang on. I think there’s a stack-level
    setDefaultFunctionProps
    now
    nope. using
    this.setDefaultFunctionProps
    in the stack, I get:
    Copy code
    Error: Default function props for the stack must be set before any resources have been added. Use 'addDefaultFunctionEnv' or 'addDefaultFunctionPermissions' instead to add more default properties.
    this is a bit confusing. this is literally before any resource gets created, it’s the first stack that gets set up
    t
    • 2
    • 22
1...181920...83Latest