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

    Bshr Ramadan

    10/08/2021, 7:46 PM
    Hello, I want to restrict access to an api gateway for only a specific other lambda function. is there a way to do that?
    t
    • 2
    • 3
  • s

    Sam Hulick

    10/08/2021, 7:59 PM
    anyone know how to properly kill hung processes w/ SST?
    Copy code
    ? Something is already running on port 12577.
    I did
    kill -9
    for any related processes. doesn’t seem to do the trick
    t
    • 2
    • 5
  • k

    Kujtim Hoxha

    10/08/2021, 9:48 PM
    Is there a way to setup API gateway to handle trailing
    /
    gracefully e.x
    abc/hello/{123}
    and
    abc/hello/{123}/
    should be both accepted and go to the same function
    f
    p
    • 3
    • 11
  • e

    Erik Robertson

    10/09/2021, 1:50 AM
    Hello folks, so I have secured my API as per https://serverless-stack.com/examples/how-to-add-cognito-authentication-to-a-serverless-api.html and tested everything works ok using
    Copy code
    npx aws-api-gateway-cli-test
    Now my question is do I make authenticated calls to the api from my client browser. I do not want to use Amplify. So far I have managed to login and fetch tokens using amazon-cognito-identity-js which is all very nice and gives me access+id+refresh tokens but once I have that how do I wrap things up to properly call the /private entrypoint in my API ? Thanks !
    c
    f
    h
    • 4
    • 21
  • k

    kierans777

    10/09/2021, 4:03 AM
    I love using the AWS CDK and for my own project, I added in the concepts of stages so I can can have
    dev
    ,
    test
    ,
    prod
    and so on. I stumbled on serverless-stack and realised where SST was better than my own (hastily) home rolled solution and I've looked into porting. I have one question regarding the management of stages/deploying. In my current CDK project, I have multiple "apps" (that is
    bin/*.ts
    ) to represent different logical areas of infrastructure. For example a "global" app for things like Hosted Zones, an "identity" app for different identity concerns, an "api" app for deploying my public facing API into multiple regions (I'm using Regional API Gateways with Route 53 latency policies). My CI/CD pipelines can then run each app as required into the correct regions/stages and it all works. However with SST there are no more "apps", just the
    stacks/index.js
    . I'm wondering how to port my CDK apps to the SST setup to maintain my existing separation of stacks into their logical areas.
    f
    j
    • 3
    • 9
  • k

    kierans777

    10/09/2021, 11:57 AM
    Is it possible to define a
    ApiGatewayV1ApiRouteProps
    instance without a Function, but just an API Gateway Mock Integration? Or will I get errors from SST?
    f
    • 2
    • 10
  • k

    kierans777

    10/09/2021, 1:15 PM
    Can you have multi path sgement keys in SST? eg:
    /accounts/{id}/transactions
    ? All the examples are single path segments like
    /notes
    but the app I want to port to SST have multi path
    f
    • 2
    • 1
  • d

    Devin

    10/09/2021, 4:59 PM
    Does anyone now how to configure Babel for an app based on the sample app? I’ve fully borked my testing setup for my example app. When I run
    npm run test
    at the project root i get
    Copy code
    cannot find module babel-jest
    with a project path pointing to:
    Copy code
    node_modules/@serverless-stack/cli/scripts/util/babelJestTransform.js
    if I install babel and drop in a config
    Copy code
    babelJest.createTransformer is not a function
    also in the CLI. How i got here was I added a test in the react app, then deploy’s broke on
    Seed.run
    see the previous thread here. At that time, at least the tests worked for the App, just not the react app. https://serverless-stack.slack.com/archives/C01JG3B20RY/p1633213092119300
    f
    t
    • 3
    • 15
  • j

    Jonathan Chapman

    10/09/2021, 7:15 PM
    I've got a weird interaction. For some of my services, I'm getting
    {"message":"Forbidden"}
    . When I switch between using
    start
    and
    deploy
    it will fix the issue for one lambda, but it at times it causes other service to return the same message. The logs for the API gateway don't really show anymore details then returning the 403. My setup is with three stacks. • StorageStack: DynameDB setups here • ApiStack: REST services and use one Lambda Authorizer for all services • WebSocketStack: Websocket rervices Any tips on where I can start to debug this?
    f
    • 2
    • 4
  • ö

    Ömer Toraman

    10/10/2021, 6:37 PM
    Hello. I would like to have your opinion on how you validate (basically which package, if any) requests (or better to say request body) that Lambda receives? (for Node.js)
    t
    s
    • 3
    • 6
  • j

    João Pedro

    10/10/2021, 8:01 PM
    hey guys! (@Frank @Jay @thdxr) 1 - I’m making a clear separation between my
    dependencies
    and my
    devDependencies
    , but on of my dev dependencies, even though it’s not a dependency of any of the dependencies, it’s going to the deployed lambda…is that expected? 2 - is there tree-shaking when deploying the lambdas?
    t
    • 2
    • 21
  • a

    arda

    10/11/2021, 1:58 AM
    Hi everyone! I just heard about SST today and start following your amazing guides! One quick question on the live lambda development - if my lambda function needs to make a dynamoDB request, then we would have to set up a VPC first, is my understanding correct?
    g
    t
    f
    • 4
    • 8
  • c

    Chad (cysense)

    10/11/2021, 3:17 AM
    Maybe someone here can help with a CDK problem I am trying to solve. I am currently moving all my code into a mono repo. At the top level of my stack I specify each stack for each environment and then when I deploy I specify the stack. So my toplevel app looks like this:
    Copy code
    const app = new <http://cdk.App|cdk.App>();
    
    new BackendStack(app, `BackendStack-dev`, {
    ...
    
    new FrontendStack(app, `FrontendStack-dev`, {
    ...
    
    new BackendStack(app, `BackendStack-sandbox`, {
    ...
    
    new FrontendStack(app, `FrontendStack-sandbox`, {
    ...
    So if I want to deploy to
    sandbox
    I can do something like this:
    Copy code
    cdk deploy --require-approval never BackendStack-sandbox 'BackendStack-sandbox/**' FrontendStack-sandbox
    The problem is everytime I synth/deploy CDK synths all stacks before dropping them for final output. The issue is that if I have time consuming operations (such as building assets) in my develop stack, I need to wait for them to complete when deploying to my sandbox stack. A solution I have found is to wrap the above constructs in if statements. This works but now I want to use the stack names I passed to cdk deploy. Does anyone know how I can reference this in code? In the example above I would like to get
    BackendStack-sandbox 'BackendStack-sandbox/**' FrontendStack-sandbox
    . I thought this would appear in the context but I am not seeing it anywhere.
    f
    • 2
    • 1
  • a

    ahmed elkordy

    10/11/2021, 3:55 AM
    can u help me to integrate https://www.npmjs.com/package/dynamodb-geo this package with stack to create table with this
    f
    s
    r
    • 4
    • 17
  • j

    Jiri Orsag

    10/11/2021, 8:18 AM
    Hi everyone, it is my very first post so excuse me if I missed something. I’m interested in calling lambda from another lambda, the 1st one is Node-based and deals with the upload itself + some validation but I would like to invoke another one which is processing the data using Python, I have found this PR about attaching permissions but I got stuck how to proceed further. Thank you
    t
    • 2
    • 10
  • g

    Garret Harp

    10/11/2021, 4:51 PM
    Is it possible to create 2 state machines that reference each other via the startexecution task?
    t
    b
    • 3
    • 4
  • ö

    Ömer Toraman

    10/11/2021, 6:03 PM
    Is it possible to specify log retention for a created stack? All I could find for specifying the log retention for a
    SAM
    app is this repository in SAR: https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:374852340823:applications~auto-set-log-group-retention So I have two questions. 1. How can I see the current retention for a stack? 2. Can I change it without per stack without specifying every log group for a function one by one?
    r
    f
    • 3
    • 7
  • d

    Dan Van Brunt

    10/11/2021, 7:33 PM
    Looks like the CDK CustomResource changed since I last used it. I things like the CustomResource Provider Framework… that reads like it handles a ton for you. For instance, a lot of examples show to implement the CR functions as
    lambda.SingletonFunction
    which makes a ton of sense if you are building a construct that could be used a number of times in the same stack…. you would not want it to reimplement the CR function as many times. However, I’d like to be able to use the same asset compression for functions that
    sst.Function
    gives you. Am I missing something, is there an easy way to have my cake and eat it too?
    t
    f
    • 3
    • 111
  • m

    Mr.9715

    10/12/2021, 6:17 AM
    Hey Guys, The external REST service I am calling takes 35-50sec to respond. I am thinking of replacing API Gateway with an Application Load Balancer. I know it's not serverless and generates a monthly bill, but I can't find a way around 30sec timeout limit at APIG. I am not sure if anyone has tried this yet but I have a couple of questions: • Should I move all routes to ALB or just the ones which are getting timed out? Since I will be paying the ALB bill anyways does it make a difference? • Should I try decoupling my API into 2 parts? It's basically a booking service. Instead of sending a req and waiting for 35-55 sec, Should I submit a job and poll for status from UI like every 10 seconds? ◦ APIG calls lambda which pushes input to SQS and returns a polling ID ◦ SQS calls the consumer lambda, which calls external service, and writes data to DB against polling ID. ◦ Another APIG route takes polling ID and checks if the record is available in DB.
    r
    k
    +2
    • 5
    • 7
  • ö

    Ömer Toraman

    10/12/2021, 7:14 AM
    Hello. I want to send “unsuccessful” Lambda invocations by APIGateway to somewhere. I guess I can define “unsuccessful” as it an invocation resulting in
    4XX
    and and
    5XX
    status codes. It’s possible that a runtime error thrown, or simply ran out of memory, or timed out. But at the end, it is still the case that APIGateway responds, in this case the statusCode would be some 5XX’s, so I would know that there is something wrong with the Lambda. As I read
    AWS::Serverless::Function
    resource properties, I see that there are two properties might be relevant, but I’m really not sure how they differ, and which one to be chosen. What is really the difference between
    DeadLetterQueue
    vs
    EventInvokeConfiguration
    r
    f
    • 3
    • 6
  • b

    Brinsley

    10/12/2021, 9:25 AM
    Hey guys, looking at Cognito User Pools for the first time and I’ve clocked that every time we make a change, even though the Auth construct remains (thanks to default RemovalPolicy), the client id and secret get regenerated. Is there any way to keep those static between updates? Had a quick look through the type def. files and through some of the sst docs but couldn’t find anything about it. I’m gonna go and look at the CDK docs next but thought I’d reach out in the meantime.
    c
    • 2
    • 5
  • a

    arda

    10/12/2021, 2:20 PM
    Hi all, question on CORS. Why do we have to configure it in both Api construct and lambda responses? Are they for different purpose?
    t
    s
    • 3
    • 14
  • d

    Dan Van Brunt

    10/12/2021, 3:15 PM
    How can we get stack outputs into our CI variables?
    t
    c
    f
    • 4
    • 27
  • r

    Rubin Damian

    10/12/2021, 4:45 PM
    Hi everyone, there was a mention of SST supporting python applications, unless I misunderstood that. Is there a guide i can follow to set one up?
    f
    j
    • 3
    • 10
  • d

    Dan Van Brunt

    10/12/2021, 8:41 PM
    Does sst CLI have a
    --no-rollback
    option like cdk CLI does?
    t
    • 2
    • 7
  • g

    Garret Harp

    10/12/2021, 8:51 PM
    Does anyone happen to know if its possible to do a loop in step functions given a number for the amount of times it should loop rather than a list of items? I know I could use a lambda to transform into an array but if I can do it without that would be nice.
    f
    • 2
    • 5
  • n

    Nick Laffey

    10/12/2021, 9:08 PM
    Is there anyway to setup policies via SST/CDK to tear down a stack after a certain amount of time? Or how are others handling making sure ephemeral stacks (feature branches) are not sitting out there forever?
    t
    f
    • 3
    • 25
  • p

    Paulo Silva

    10/12/2021, 10:20 PM
    Hello everyone, first of all thank you for working on this amazing piece of software ❤️ I am currently stuck trying to deploy my first stack, a simple hello world. When running 'npx sst deploy' I get stuck at the MFA phase, I put in the code(nothing shows, like a sudo password prompt), I press enter, nothing happens.
    t
    f
    +2
    • 5
    • 20
  • s

    Sebastian Sieber

    10/13/2021, 2:12 AM
    Hello everyone! Basic question: after
    npx sst remove
    I went into AWS and "cleaned up" whatever wasn't removed... apparently not a good idea, because if I now run
    npx sst start
    I get the following error:
    Deploying stacks
    dev-1xxxxx-debug-stack: deploying...
    [0%] start: Publishing xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:current
    [50%] fail: No bucket named 'cdk-xxxxxxxxxxx-assets-xxxxxxxxx-us-east-1'. Is account xxxxxxxxxxxxxxxxxx bootstrapped?
    [50%] start: Publishing xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:current
    [100%] fail: No bucket named 'cdk-xxxxxxxxxxxxxx-assets-xxxxxxxxxxxx-us-east-1'. Is account xxxxxxxxxxxxx bootstrapped?
    There should be a simple solution to this, unfortunate wasn't able to find any answers online, appreciate any help!
    t
    • 2
    • 2
  • b

    Brinsley

    10/13/2021, 6:52 AM
    So, I’ve got a bit of a weird one and it’s probably more CDK related, but I’ve decided to split out my Cognito User Pool (and client) code in to it’s own stack to make some planned work more manageable. In this stack I’m create a config object for my API in another stack. I’ve tried it a couple of different ways and I’m getting a circular reference detected when CDK tries to synth. My set up: • index file creates cognito stack • cognito stack takes the app in constructor (like all stacks do) • cognito stack set up the user pool/client • cognito stack builds a config using some of its resources values • index passes the expose config to my api stack The cognito stack doesn’t reference anything from outside of itself and only uses the
    app
    var to pass to the sst.Stack
    super
    . Anyone else come across anything like this before?
    f
    • 2
    • 2
1...222324...83Latest