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

    Ross Gerbasi

    02/04/2022, 5:56 PM
    This is not SST specific, just general "help". I feel like I ask this question every few months, but what are folks doing for websocket auth? I know the SST docs show how to wire up an authorizer but I am curious what folks are putting in there. Seeing that someone decided websocket connections from the browser didn't needs headers 🤦‍♂️ Are folks just risking the query string with a token? Hacking around with basic auth? or just letting anyone pop on the line and applying auth at the topic listen / message send level?
    t
    a
    • 3
    • 9
  • d

    Devin

    02/04/2022, 7:40 PM
    I’m trying to work around this 403 issue with StaticSite (https://github.com/serverless-stack/serverless-stack/issues/1332). I found this article (https://levelup.gitconnected.com/use-aws-cdk-to-deploy-a-s3-bucket-static-content-and-create-route53-entries-219038d43eb) that recommends you set public read access which I can do through the static site construct. But then there’s an
    s3Deployment
    step that I can’t really figure out how to integrate into that static site construct.
    Copy code
    const site = new sst.StaticSite(this, "site", {
          path: "website",
          errorPage: "404.html",
          buildOutput: "public",
          buildCommand: "npm run build",
          customDomain: getCustomDomain(scope.stage),
          s3Bucket: {
             // in here I can set publicReactAccess and removal along with moving the index doc here
          }
         s3Deployment: // does not exist, I'd expect it to but maybe I just need to call cdk directly to host a static site?
    })
    f
    • 2
    • 2
  • j

    Jacob Hayes

    02/04/2022, 9:09 PM
    We’re using yarn/webpack across our monorepo currently, but have a new service that has dependencies that don’t seem to play well with webpack. Manually deploying after building with npm works fine Is it possible to set up that specific service in SEED such that it uses npm instead of yarn for this specific service?
    f
    • 2
    • 2
  • i

    Iamgingertrash

    02/05/2022, 4:09 PM
    Having an issue with the
    sst.Stack
    - I'm trying to hook up external monitoring and using
    this.getAllFunctions()
    but it throws an error saying that
    getAllFunctions
    is not a function
    f
    d
    • 3
    • 11
  • k

    Kristian Lake

    02/05/2022, 6:51 PM
    hey guys, using dynamodb and a lambda via the gateway api. What do you guys do when your posting an update that creates a row in your database, but you want to make sure its unique? for example If I were to run curl -X POST -H 'Content-Type: application/json' -d '{"emailAddress":"Example@123.com"}' https://endpoint.amazonaws.com/subscribe The first time it would add the entry into dynamo db, but the second time it would reject because it already exists. Currently When i add, it just adds a second item into my database. my table creation is as follows. this.EmailSubscribersTable = new sst.Table(this, "Email_Subscribers", {       fields: {         subscribeId: sst.TableFieldType.STRING,         emailAddress: sst.TableFieldType.STRING,         confirmed: sst.TableFieldType.BOOL,         timestamp: sst.TableFieldType.STRING,       },       primaryIndex: { partitionKey: "subscribeId", sortKey: "emailAddress" },
    t
    r
    d
    • 4
    • 90
  • g

    Garret Harp

    02/05/2022, 11:18 PM
    Is there a reason why the accessLog definition on sst.Api does not accept RetentionDays from
    aws-cdk-lib/aws-logs
    ?
    f
    • 2
    • 5
  • i

    Iamgingertrash

    02/07/2022, 4:17 AM
    Is it possible to use my own custom naming scheme for Lambda functions deployed using SST?
    t
    j
    f
    • 4
    • 17
  • j

    Jason

    02/07/2022, 2:29 PM
    We recently started using sst and seed. Currently we have a couple of lambdas in there that connect to our RDS for various things. Sst has made that really easy without needing to know much about aws. Now, we want to implement an image handling service and https://github.com/aws-solutions/serverless-image-handler has the exact functionality we want. In my head, ideally we would migrate that project (which is cdk based if I understand correctly?) to sst so that everything is unified. Is this a good idea? There's a lot of code there so I don't know how simple it will be to do this migration so asking up front if it's worth doing and how much work it might be for someone unfamiliar with it all. Keeping in mind we don't have any of the resources it uses or any state to carry over. It's a complete greenfield for us
    d
    r
    • 3
    • 26
  • d

    David Garcia

    02/07/2022, 6:19 PM
    Hey there, this is /kind of/ a bug report, I guess. This link is being displayed when I run
    yarn deploy
    https://docs.serverless-stack.com/working-locally#deprecating-the-stage-option-in-the-sstjson Something about stage option being deprecated, but this link leads to nowhere regarding this information
    f
    • 2
    • 3
  • j

    John

    02/08/2022, 3:23 AM
    Hey all, hope you're doing well. Looking for opinions. I want to build a web app and I'm shopping around. SST looks great so far and is something I'd be interested in trying. But this is my concern. I have a hard requirement to use RDS (not aurora serverless) for my DB and I can't find an SST example for that yet. Since I want to develop with lambdas and use SST at its fullest, is this supported (e.g. lambda debugging)? Is it feasible? Does it make for a good developer experience, compared to developing with a regular web framework? Would really appreciate to hear your thoughts. Thanks in advance!
    t
    s
    • 3
    • 4
  • a

    Ash Rhazaly

    02/08/2022, 3:48 AM
    Are there any plans to support custom verification triggers for cognito https://docs.serverless-stack.com/constructs/Auth#authuserpooltriggers, a use case I have would be using external 3rd parties like Twilio to verify a user's phone, https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html , AWS recently released some custom triggers but these triggers are not available on the console as yet
    f
    • 2
    • 3
  • t

    Tim Alander

    02/08/2022, 4:12 AM
    hi all, assuming I have two stacks:
    API.ts
    --> this uses
    sst.Api
    Storage.ts
    --> this uses
    rds.ServerlessCluster
    How can I give the API stack permission to access the RDS instance. I see examples where you can do
    api.attachPermissions
    from within
    API.ts
    , but then I don't have reference to the RDS construct. Is there a pattern for passing around construct references in the constructors of the stacks? How else would you accomplish this? Thanks!
    a
    f
    • 3
    • 3
  • d

    Daniel Gato

    02/08/2022, 1:16 PM
    I’m looking for a way to set a custom Attribute on the Auth construct with some default value. Any examples on that around?
    f
    • 2
    • 5
  • d

    Dan Beaven

    02/08/2022, 1:33 PM
    Hi i have an Api construct with a
    defaultAuthorizer: HttpUserPoolAuthorizer
    however I need some routes to be public and adding
    authorizationType: sst.ApiAuthorizationType.NONE
    to the public routes config doesn't remove the authorisation from api gateway. I also tried removing
    defaultAuthorizer
    and instead adding
    authorizer:HttpUserPoolAuthorizer
    on the individual route config however this resulted in no authorizer being attached and all routes being public any ideas what I am doing wrong?
    r
    f
    • 3
    • 3
  • s

    Slackbot

    02/08/2022, 9:16 PM
    This message was deleted.
    d
    • 2
    • 2
  • d

    Dan Van Brunt

    02/08/2022, 9:21 PM
    Does anyone know if there is an easy way to “clone” and change certain aspects of a core construct Instance? I already have a cloudfront distro built in
    sst.StaticSite
    and I’d like to create a SECOND distro with a different domain and WAF but pointed at the same origin/bucket
    d
    • 2
    • 6
  • d

    Daniel Gato

    02/09/2022, 1:12 PM
    Is there a version for the guide in typescript? I have issues to convert handler.js to typescript (as it can handle multiple different events)
    t
    • 2
    • 5
  • d

    Dan Van Brunt

    02/09/2022, 2:51 PM
    Anyone know what the actual settings are for
    cf.CachePolicy.CACHING_DISABLED
    ? I basically want NO caching… but I DO want CF to passthrough the querystrings
    c
    • 2
    • 8
  • d

    Dan Beaven

    02/09/2022, 4:30 PM
    I have a sort of circular dependancy question basically I have an Auth stack and a NextJS stack. They are both using custom domains with prefixes
    <http://auth.staging.site.com|auth.staging.site.com>
    and
    <http://staging.site.com|staging.site.com>
    however Rout53 requires that an A record exist for a subdomain before it can create a nested sub-domain. The NextJS stack relies on parameters from the Auth stack so I cant just deploy the NextJS site first. When I add a temporary A record entry for
    <http://staging.site.com|staging.site.com>
    the auth stack deploys fine however the NextJS stack fails saying it couldn't create the domain A record because one already exists. Does anyone have any ideas on how to get around this?
    t
    • 2
    • 2
  • d

    David Garcia

    02/09/2022, 4:50 PM
    Hi there, is it possible to signal to sst to only remove one stack?
    a
    • 2
    • 2
  • d

    David Garcia

    02/09/2022, 6:29 PM
    Hey, I keep having this issue intermittently and my usual workaround is to just go into the console and delete a stack, but here is the issue, i'm wondering if there's a better, more time efficient, fix I deployed stack 1 that attempted to stand up a rest api, but there was a conflict with stack 2 that had an api under a similar name, so stack 1 was rolled back and all the resourced it tried to stand up were deleted. I'm in the process of removing stack 2, and I'm now trying to deploy stack 1. On AWS console it's status is 'ROLLBACK_COMPLETE' and all resources under the stack have either status 'DELETE_COMPLETE' or 'DELETE_SKIPPED', thus, my expected behavior when deploying stack 1 is that it would re-attempt to stand up the resources it initially failed to create. However, when I run
    yarn deploy
    the status of my stack in the console is
    Status: no changes
    f
    • 2
    • 3
  • k

    Kujtim Hoxha

    02/09/2022, 8:21 PM
    Is there an easy way to change the access log group of the API gateway? it looks like Datadog wants it to start with `aws-gateway`https://docs.datadoghq.com/integrations/amazon_api_gateway/#log-collection
    j
    f
    • 3
    • 5
  • m

    Michael Bannon

    02/09/2022, 9:22 PM
    Hi, I’m receiving an error when I try to visit my API endpoint. In the terminal, it says 'unhandled promise rejection …" and then in the browser it displays {“message”:“Internal Server Error”} Any help appreciated thanks From this page in the guide: https://serverless-stack.com/chapters/create-a-hello-world-api.html
    f
    j
    • 3
    • 9
  • b

    Bshr Ramadan

    02/09/2022, 11:52 PM
    Hello what is
    lambda-code-updater
    in NextJs used for? actually I am getting this recommendation from compute optimizer for this lambda function
    f
    • 2
    • 4
  • s

    Sam Hulick

    02/10/2022, 1:39 AM
    is this stuck for anyone else? I have the latest version of SST
    f
    t
    • 3
    • 37
  • b

    Bogdan

    02/10/2022, 3:05 AM
    Hi! 1. Does anyone have more info on ETA on support for CDK with golang? Where can I view this info? 2. Are functions with Image type supported?
    t
    k
    • 3
    • 9
  • y

    Yap Yee Qiang

    02/10/2022, 4:46 AM
    Hey guys! Hope everyone is doing good. I have a question on building a Serverless Payment System with Stripe. Is it possible to create a serverless app with SST that can allow multiple applications to talk to different Stripe Endpoint? Let me know your thoughts or if anything unclear, let me know so I can try to explain it better. Thanks in advance guys!
    o
    f
    • 3
    • 8
  • p

    Pablo Fernandez

    02/10/2022, 9:17 AM
    I'm going through the guide, and when deploying to prod, I'm getting this error:
    Copy code
    prod-ww3-api failed: The domain name you provided already exists. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: 04242074-0225-44bc-a8d1-a1cf94aef985; Proxy: null)
    It is correct that the domain name already exists, it's handled by CDK, it has many more entries (email, and other things). The frontend didn't have a problem with the domain existing though, it just injected the records into it.
    f
    j
    • 3
    • 24
  • p

    Pablo Fernandez

    02/10/2022, 10:59 AM
    In my
    ReactStaticSite
    I've defined
    domainName
    and
    domainAlias
    .
    domainAlias
    seems to both get an
    A
    and
    AAAA
    record but
    domainName
    seems to be missing the
    AAAA
    record. Is this a bug? is this intended? did something silently fail on my deployment?
    f
    j
    • 3
    • 17
  • f

    Fazi

    02/10/2022, 11:41 AM
    Hi, I define a custom authorizer as:
    Copy code
    const authorizer = new HttpLambdaAuthorizer({
          authorizerName: 'authorizer',
          handler: new Function(this, 'Authorizer', {
            functionName: 'AuthorizerFn',
            srcPath: "src",
            handler: 'authorizer.main',
            tracing: lambda.Tracing.DISABLED,
            timeout: 30,
            permissions: ['ssm'],
          }),
          resultsCacheTtl: Duration.seconds(0),
          responseTypes: [HttpLambdaResponseType.SIMPLE],
        });
    I then want to apply it to a specific route as follows:
    Copy code
    const api = new Api(this, "Api", {
          // defaultAuthorizationType: ApiAuthorizationType.JWT,
          // defaultAuthorizer: new HttpUserPoolAuthorizer({
          //   userPool,
          //   userPoolClient,
          // }),
          // defaultAuthorizationType: ApiAuthorizationType.CUSTOM,
          defaultAuthorizer: authorizer,
          routes: {
            
            // some other routes go here
            
            "GET /v1/tasks/alt": {
              function: getTasksAltFunction,
              authorizationType: ApiAuthorizationType.CUSTOM,
            },
            
            // some other routes go here
          },
        });
    However, when I make a call to
    GET /v1/tasks/alt
    I get a unauthorized error. Can someone please explain what is going wrong? I used the docs here: https://docs.serverless-stack.com/constructs/Api#adding-lambda-authorization-to-a-specific-route
    r
    • 2
    • 7
1...495051...83Latest