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

    Zack McKenna

    02/15/2022, 8:46 PM
    My role policy is unable to create new roles. Is there a way to set default function props / stack synthesizer for the debug stack, so I can provide it the necessary roles and doesn’t try to create them?
    f
    j
    • 3
    • 48
  • f

    Filip Pyrek [AWS Hero]

    02/15/2022, 10:52 PM
    Hi guys, is it possible to set
    stage
    dynamically in SST? For example in my case based on git branch. In Serverless Framework I’ve accomplished this via javascript file variables. Inside the file was a function which extracted git branch and returned it as a string which then became value of the
    stage
    variable.
    d
    a
    +3
    • 6
    • 23
  • a

    Ashishkumar Pandey

    02/16/2022, 5:06 AM
    I have an HTTP API that uses a custom domain as such :-
    Copy code
    customDomain: {
        domainName: `${stageSubDomain}.${process.env.HOSTED_ZONE_NAME}`,
        hostedZone: hostedZone,
        path: process.env.API_VERSION, // this is 'v2'
      }
    I’m now trying to create another HTTP API in the same stack with the custom domain path set to ‘v3’ for versioning sake but this fails and errors out with this message :-
    Copy code
    <http://abc.pqr.xyz|abc.pqr.xyz> already exists in stack arn:aws:cloudformation:region:xxx:stack/dev-api-v2-media-stack/xxxxxx
    Is there a way to achieve path level versioning with route53 custom domains with HTTP APIs?
    f
    d
    • 3
    • 6
  • n

    Noah D

    02/16/2022, 12:02 PM
    Hey does anyone know what type I should be using for my API gateway events if i am using cognito identity pool auth like seen in the guide? So far have been using
    APIGatewayProxyEventV2
    from
    @types/aws-lambda
    fine, however have been trying to get the identity pool id like seen in the guide using
    event.requestContext.authorizer.iam.cognitoIdentity.identityId
    however the type seems to not think this field exists (it definitely does). My version is
    "@types/aws-lambda": "^8.10.92",
    so might be related to that, but figure someone might have some insight into correct version to use if so 🙏
    d
    f
    • 3
    • 9
  • j

    Justin Robinson

    02/16/2022, 12:56 PM
    Hey all, Is there anywhere I may be able to find an example of using ApiGatewayV1Api with request schema validation json file input. I get from using dasm, you'd use the L0 apigateway.CfnModel & apigateway.CfnRequestValidator somehow, but I can't see where they would be added into ApiGatewayV1Api
    f
    • 2
    • 1
  • d

    Dan Van Brunt

    02/16/2022, 4:46 PM
    [Opinions Wanted]: What might be the pros/cons of using one of these two solutions over the other for keeping s3 buckets insync? 1. Using AWS Step Functions 2. Using Simple AWS Lambda Particularly interested in major differences in: • features • cost • stability • speed
    d
    a
    a
    • 4
    • 14
  • p

    Pablo Fernandez

    02/16/2022, 6:38 PM
    On https://serverless-stack.com/chapters/call-the-list-api.html there's a line
    return API.get("notes", "/notes")
    . What's the first argument? "notes"? What does it match? I'm getting
    API notes does not exist
    in my app (which is a bit different).
    d
    • 2
    • 3
  • d

    Devin

    02/16/2022, 7:06 PM
    Is there a difference between an edge function and a function? Like do I need to import
    Copy code
    import { EdgeFunction } from "@serverless-stack/resources";
    or something? Or is what makes it “edge” that I’m doing some config work with
    cfDistrobution
    f
    d
    • 3
    • 5
  • j

    Joshua Oransky

    02/16/2022, 8:04 PM
    Hello everyone... I'm trying to get my application to deploy via Seed, but I'm running into some errors that I'm not getting when I start, build and deploy locally. When I try to deploy, for my StaticSite, I get this error when it tries to install the npm deps:
    Copy code
    $ cd /tmp/seed/source
    INFO: Running before_build hook
    $ echo "Before build"
    0.08 s
    $ cd website && npm install
    82.19 s
    $ npx sst build --stage dev --region us-west-2 --verbose
    0.60 s
    npm ERR! could not determine executable to run
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2022-02-16T19_55_37_431Z-debug.log
    ERROR: There was an error synthesizing your app.
    I have a build spec:
    Copy code
    before_build:
     - cd website && npm install
    I feel like there's something simple I'm missing, but I can't figure it out. Thanks for any help!
    • 1
    • 1
  • d

    Dan Van Brunt

    02/17/2022, 1:19 AM
    [Possible Bug]:
    Received response status [FAILED] from custom resource. Message returned: Waiter InvalidationCompleted failed: Max attempts exceeded
    This is the second time I’ve gotten this today. No rhyme or reason though, as consecutive tries seem to work.
    f
    j
    • 3
    • 4
  • f

    Filip Pyrek [AWS Hero]

    02/17/2022, 1:25 PM
    How is packaging/transpilation being done in SST? And how source maps are handled there? My case: I have lerna-based repository and I want to import some local lerna TypeScript package (
    @package/logger
    ) to my function. - that works ✅ When error is thrown inside the local lerna package (
    @package/logger
    ), the stack trace is broken and doesn’t show much. ❌ For example:
    Copy code
    {
      "errorType": "some-error",
      "errorMessage": "hello",
      "name": "some-error",
      "stack": [
        "some-error: hello",
        "    at l (/var/task/src/lambda.js:1:386)",
        "    at Runtime.p [as handler] (/var/task/src/lambda.js:1:467)",
        "    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
      ]
    }
    The stack trace should lead to
    @package/logger
    files.
    a
    t
    • 3
    • 10
  • p

    Philipp Gaissert

    02/17/2022, 6:17 PM
    Hey all! We had to specify the naming "Qualifier" for the bootstrapping stack (CDKToolKit) due to restrictions on AWS resource-naming imposed by our IT dept, which is fine for normal deployment if we override the
    DefaultStackSynthesizer
    . However, when we try to deploy a debug stack for local debugging with
    sst start
    , it gets caught in a failing loop in which it keeps trying to create a new bootstrapping stack, which fails because the default resource names violate our restrictions. How can we force sst/cdk to use our already-existing bootstrapping stack?
    f
    • 2
    • 14
  • e

    Ernie Francis

    02/17/2022, 7:43 PM
    the command seems to deploy 2 stacks, im not sure is this is intended or i misconfigured my backend.
    Copy code
    BlackFenix2-bip-debug-stack and BlackFenix2-bip-bip-stack
    d
    f
    • 3
    • 6
  • e

    Ernie Francis

    02/17/2022, 7:58 PM
    Do we have a example of a stack with auth and AWS Amplify?
    d
    • 2
    • 11
  • d

    Devin

    02/17/2022, 7:59 PM
    ** this is not a SST issue but CDK within SST I’m a bit in over my head and looking for some help. My goal is to have a function run at the edge, every time a resource is called from my static site. The function is located with the rest of the my functions (in
    src/
    . my project is in
    us-east-1
    . Below is a simplified version of my code.
    Copy code
    import * as sst from "@serverless-stack/resources";
    
    import { LambdaEdgeEventType, experimental } from "aws-cdk-lib/aws-cloudfront";
    import * as lambda from "aws-cdk-lib/aws-lambda";
    
    export default class MarketingStack extends sst.Stack {
      constructor(scope, id, props) {
        super(scope, id, props);
    
        const originRewriteHandler = new experimental.EdgeFunction(
          this,
          "OriginRewriteFunc",
          {
            runtime: lambda.Runtime.NODEJS_14_X,
            handler: "src/rewriter.main",
          }
        );
    
        const staticSite = new sst.StaticSite(this, "Site", {
          path: "website",
          errorPage: "404.html",
          buildOutput: "public",
          buildCommand: "npm run build",
        });
    
        staticSite.cfDistribution.addBehavior("/*", staticSite.s3Bucket, {
          edgeLambdas: [
            {
              functionVersion: originRewriteHandler.currentVersion,
              eventType: LambdaEdgeEventType.ORIGIN_REQUEST,
            },
          ],
        });
      }
    }
    When I try to tun this I get a type error that it can’t read
    bind of undefined
    . Which makes sense since I have no idea what I’m doing 🤣 . Actually, I figure that it’s trying to connect the bucket and the lambda but I’m missing something. I don’t really kno how to debug this.
    f
    • 2
    • 8
  • f

    Filip Pyrek [AWS Hero]

    02/17/2022, 8:00 PM
    Is it possible that by enabling lambda source maps (like suggested here -
    setDefaultFunctionProps
    ) the live VScode lambda debugging gets broken? When I remove that environment setting from the stack and deploy it, the debugger starts to catch the breakpoints. When I return it back and deploy it, it doesn’t catch any breakpoint. Is VScode lambda debugger be taking into considerations the source maps anyhow when handling the breakpoints?
    f
    t
    +3
    • 6
    • 24
  • m

    Michael Clifford

    02/17/2022, 8:24 PM
    Question: Your Cognito JWT examples use the CDK
    Cognito
    construct. Can the same be achieved with the
    sst.Auth
    construct? I was wondering why my User Pool wasn't showing up in the console when I realized this.
    f
    • 2
    • 22
  • p

    Philipp Gaissert

    02/17/2022, 10:27 PM
    Anyone else encountering an issue in which you supply a
    restApiName
    to a new
    ApiGatewayV1Api
    , but it still ends up getting named
    {stage}-{app}-{constructId}
    ?
    f
    • 2
    • 9
  • e

    Ernie Francis

    02/18/2022, 3:01 AM
    does the sst.Auth class support adding social login via the userpool?
    f
    • 2
    • 18
  • s

    Sean Matheson

    02/18/2022, 9:19 AM
    Howdy all, I have the unfortunate requirement of having to define a traditional (non Aurora) Postgres RDS instance, and then have an
    Api
    interact with it. Does anyone have an example of the CDK magic they performed to do the similar. I'm seeing wildly different examples out in the Internets, and I've come to trust the members of this community to have a much more precise and pragmatic approach to their CDK definitions. I'm only looking to have the RDS instance running for an actual deployment, for local I'm going to defer to a docker PG instance.
    s
    f
    s
    • 4
    • 8
  • h

    heyysaiii

    02/18/2022, 10:12 AM
    Hey all, I'm a beginner to sst and trying to create a sign up/login page where user will only put their phone number, and they will get an otp , after providing the otp the user will be logged in (no need of email and pass). I'm following the serverless stack to build up the web app in the sst and there is only email and pass are mentioned. Can it be done with mobile number in sst itself ? Please help me to solve this. Thanks
    t
    f
    m
    • 4
    • 14
  • d

    Daniel Gato

    02/18/2022, 11:07 AM
    RDS is not in our region and we would like to use it. How should we proceed to change region? sst delete on each environment and then change the sst.json ? Are we missing something here?
    r
    • 2
    • 5
  • d

    Daniel Gato

    02/18/2022, 12:26 PM
    How to handle the situation when you have a function that is an trigger event of a bucket and needs the name of the bucket as env? Is there a way to do this without a cyclic reference error? Part of the same stack, it works, but in a different stack it won’t work.
    f
    • 2
    • 7
  • p

    Piers Williams

    02/18/2022, 12:46 PM
    All of a sudden my
    AWS_PROFILE=xyx sst start
    isn't working as expected, and hangs after printing
    Copy code
    ==========================
     Starting Live Lambda Dev
    ==========================
    
    SST Console: <https://console.serverless-stack.com/>...
    the SST console site says
    No stacks found for app deploy-controller and stage piers
    - I'm not sure where it's getting this stage from as I've not started sst with that stage parameter, any suggestions on what I can do to get past this and be able to test the frontend locally again?
    t
    j
    f
    • 4
    • 9
  • e

    Ernie Francis

    02/18/2022, 2:48 PM
    When i try to add an AWS cognito userpool to my serverless stack, i get this error:
    Copy code
    TypeError: Cannot read properties of undefined (reading 'UserPool')
        at new BipStack (C:\Users\Asus\Documents\GitHub\bip\aws-backend\stacks\BipStack.ts:23:34)
        at Object.main (C:\Users\Asus\Documents\GitHub\bip\aws-backend\stacks\index.ts:17:3)
        at Object.<anonymous> (C:\Users\Asus\Documents\GitHub\bip\aws-backend\.build\run.js:94:16)
        at Module._compile (node:internal/modules/cjs/loader:1101:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
        at Module.load (node:internal/modules/cjs/loader:981:32)
        at Function.Module._load (node:internal/modules/cjs/loader:822:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:17:47
    f
    • 2
    • 6
  • d

    Daniel Gato

    02/18/2022, 4:24 PM
    Is there an example what information I need to pass from sst.RDS to my lambda to execute a query from?
    m
    f
    a
    • 4
    • 20
  • k

    Kristian Lake

    02/18/2022, 5:29 PM
    anyone have any idea why the sst debugging becomes unavailable?
    r
    f
    • 3
    • 56
  • r

    Riccardo Brero

    02/18/2022, 6:31 PM
    Hi, I'm following the guide on using Cognito for user authentication (https://serverless-stack.com/chapters/using-cognito-to-add-authentication-to-a-serverless-app.html) but I would like to avoid using AWS Amplify. One solution would be to log in users through an HTTP API and use, for example, a JWT to authenticate calls to API endpoints that I want to be accessible only to registered users. Unfortunately, however, I have not found any resources on how to manage Cognito users on the server side, any help would be appreciated, thanks.
    a
    f
    • 3
    • 7
  • d

    Daniel Gato

    02/18/2022, 6:36 PM
    Is there a way to attach a
    DockerImageFunction
    to a Bucket notification? I’m getting:
    Copy code
    Type 'DockerImageFunction' is not assignable to type 'FunctionDefinition'.
      Type 'DockerImageFunction' is missing the following properties from type 'Function': _isLiveDevEnabled, localId, attachPermissions, getConstructMetadata ts(2322)
    f
    • 2
    • 5
  • p

    Philipp Gaissert

    02/18/2022, 7:29 PM
    When I add a route to an
    sst.WebSocketApi
    that uses a Lambda integration, the source ARN of the API Gateway trigger that gets added to the Lambda function appears to be incorrectly formatted
    f
    • 2
    • 5
1...515253...83Latest