https://serverless-stack.com/ logo
Join SlackCommunities
Powered by
# sst
  • m

    Michael Orcutt

    08/24/2021, 2:59 PM
    Hey there, I'm running into a perms issue that I can't seem to figure out. Anyone know what is needed to resolve the following?
    Insufficient permissions to enable logging (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException
    f
    • 2
    • 2
  • s

    Sam Hulick

    08/24/2021, 7:01 PM
    ooh man.. my API stack is getting rather full šŸ˜… I think CF has a 500 resource limit, right? anyone else run into this limit yet? I wonder if it might make sense to just centralize the permissions so they all share the same policies (like Serverless Framework does). it’s not ideal, but with every single API endpoint having its own policies, it definitely eats up that resource quota
    f
    t
    t
    • 4
    • 21
  • a

    AdriƔn Mouly

    08/24/2021, 7:10 PM
    I’m using API GW v2 with an HTTP Mapping, but the
    path params
    apparently are not working? in the Console is not showing anything for those mappings? I’m mapping from a subdomain to another domain. This is my code
    Copy code
    routes: {
            'GET /projects/{projectId}/filters': {
              url: `${BASE_URL}/hey-xxxx/projects/{projectId}/filters`,
              method: HttpMethod.GET,
              timeout: 30,
            },
          },
    f
    • 2
    • 16
  • s

    Sam Hulick

    08/24/2021, 7:53 PM
    this is always a strange error (when running `sst start`:
    Copy code
    Rebuilding infrastructure...
    Rebuilding infrastructure failed
    no details, no error msg. I just kill the process & rerun it, and it’s usually fine
    a
    f
    j
    • 4
    • 12
  • a

    AdriƔn Mouly

    08/25/2021, 11:04 AM
    I’ve created an API mapping for a custom domain, and this works fine. But I want to define
    GET /careers
    , and doesn’t seams to be possible? the URL will be
    /careers/
    .. notice the
    /
    at the end. Is there a way to tell the API to map
    /careers
    and
    /careers/
    ? Also, is there any convention, or best practice on this topic? I have been defining APIs without the ending
    /
    all my life, but maybe is not correct.
    f
    • 2
    • 13
  • a

    AdriƔn Mouly

    08/25/2021, 11:18 PM
    Is this new?
    āŒ mycomp-vpc-stack failed: The mycomp-vpc-stack stack contains no resources.
    I’m using an stack to lookup for the existing VPC… never failed until I did the update?
    t
    f
    • 3
    • 42
  • r

    Ross Coundon

    08/26/2021, 11:37 AM
    I can't seem to be able to set permissions to
    permissions: [sst.PermissionType.ALL]
    in either defaultFunctionProps at the app level or at an individual function level. I get the error:
    Copy code
    Error: Action '*:*' is invalid. An action string consists of a service namespace, a colon, and the name of an action. Action names can include wildcards.
    t
    • 2
    • 1
  • a

    Alex Price

    08/26/2021, 1:50 PM
    Can I see
    sst.Cron
    instances in AWS? I've got some basic code and it doesnt seem to be working and I'm not sure how to debug it šŸ¤”
    s
    r
    f
    • 4
    • 43
  • b

    Blake E

    08/26/2021, 7:16 PM
    Hola! I created my sst using
    --language typescript
    but I failed to read through docs to add
    --use-yarn
    and my
    sst add-cdk
    is complaining (and using npm). Where is this set? I’d like to change this after the boilerplating my project šŸ™
    t
    • 2
    • 17
  • a

    AdriƔn Mouly

    08/27/2021, 5:04 AM
    Is there a way to define dependencies between stacks? For example I have 1 stack that has some main foundation components.. if this fails to create, I dont want other stacks to be executed or created.
    f
    • 2
    • 6
  • l

    Luke Wyman

    08/27/2021, 7:51 AM
    Does sst do anything to help seed dynamodb tables, or do we need to script that?
    t
    • 2
    • 2
  • a

    AdriƔn Mouly

    08/27/2021, 5:15 PM
    Is there a way to avoid type-checking over dependencies? Middy apparently imports x-ray, but I’m not using that.
    t
    s
    • 3
    • 44
  • a

    AdriƔn Mouly

    08/27/2021, 7:09 PM
    Not sure if anybody experienced this… but sometimes there are resources that takes like 20 minutes to be deleted. In this case it’s an authorizer and it’s associated resources. Anybody experienced delays when deleting roles and things like that? This happened to me on SLS too.
    t
    f
    +2
    • 5
    • 12
  • a

    AdriƔn Mouly

    08/27/2021, 8:48 PM
    Is there a way to configure the
    sst test
    command? In my case Jest is finding some folders outside of my SST project that I don’t want to test.
    t
    • 2
    • 4
  • a

    AdriƔn Mouly

    08/27/2021, 9:15 PM
    Running
    sst test --testPathPattern=test/
    for my SST stacks tests… any ideas what could be this issue?
    f
    s
    t
    • 4
    • 32
  • b

    Blake E

    08/27/2021, 9:18 PM
    Hey, should I be using
    cdk.Fn.import_value
    for sharing values across sst projects? for context, I have a SNS Topic setup in project ā€œEventsCoreā€, and I want ā€œReaderApiā€ to subscribe.
    this.addOutputs(..)
    from EventsCore and import value in ReaderAPI? Or any cleverness/best-practices I could be considering?
    a
    • 2
    • 77
  • b

    Blake E

    08/27/2021, 9:43 PM
    ^ btw, I’m trying to avoid the restrictions on the Export option of outputs in https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html
    f
    • 2
    • 8
  • l

    Luke Wyman

    08/28/2021, 12:25 AM
    I have two stacks that point to the same folder for lambda functions/api routes. The
    Auth
    stack uses a function in the singers module, because it creates a singer from the user record in the Cognito UserPool in the
    postConfirmation
    Cognito trigger. The
    Singers
    stack points to the singers module, too, because it handles the rest of the singers functionality. This wasn't an issue back in my Node days, but now seems to be a hassle with Python. Since Python uses
    srcPath
    to point to the folder, and then the route just points to the lambda file itself, it seems that
    Auth
    stack is claiming all the lambda files in the singers folder, and then when the
    Singers
    stack tries to claim the remainder of the lambda files, it can't have any because:
    Copy code
    Building Lambda function src/services/singers/KAR_SNG_get_singer_by_id.handler
    Error: Asset is already associated with another stack 'test-karaoke-auth'. Create a new Code instance for every stack
    I could create a separate folder for that one function that Auth needs, and I will if I have to, but it feels like a bit of a hack. Is there a configuration refinement I can use to not let
    Auth
    be greedy and steal all the lambdas in
    Singers
    ?
    f
    • 2
    • 6
  • a

    AdriƔn Mouly

    08/28/2021, 6:01 AM
    File
    cdk.context.json
    should be added to source control?
    f
    • 2
    • 30
  • a

    AdriƔn Mouly

    08/28/2021, 6:41 AM
    I’m getting this warning, but what is supposed to be the type on those
    catch
    ? Looks like has to be
    any
    or
    unknown
    but the linter doesn’t allow it.
    Copy code
    71:19  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
    r
    f
    • 3
    • 6
  • o

    Omi Chowdhury

    08/28/2021, 5:27 PM
    Is there a way to specify input path on an EventBridge Rule? Porting some stuff over from serverless, where it looks like:
    Copy code
    IndexLedgerLinesRule:
          Type: AWS::Events::Rule
          Properties:
            EventBusName: some=eb
            EventPattern:
              source:
                - some-source
              detail-type:
                - some-detail
            Targets:
              - Id: IndexLedgerLinesQ
                Arn: !GetAtt IndexLedgerLinesQ.Arn
                InputPath: '$.detail'
    f
    • 2
    • 4
  • a

    AdriƔn Mouly

    08/29/2021, 9:55 PM
    Does anybody know how to do Throttling/rate-limiting on API GW v2 APIs? maybe with the
    Api
    construct? Found that documentation shows this example, but HOW we do it with CDK?
    Copy code
    aws apigatewayv2 update-stage \
        --api-id a1b2c3d4 \
        --stage-name dev \
        --route-settings '{"GET /pets":{"ThrottlingBurstLimit":100,"ThrottlingRateLimit":2000}}'
    Found this on CDK, but this is for GW v1 😩 . https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigateway.ThrottleSettings.html
    f
    • 2
    • 25
  • l

    Luke Wyman

    08/30/2021, 1:27 AM
    I'm currently on version
    0.35.1
    for
    @serverless-stack/cli
    and
    @servlerless-stack/resources
    . I'd like to upgrade to
    v0.40.4
    . What is the best yarn command I can run to upgrade, given that my dependencies look like:
    Copy code
    "dependencies": {
        "@aws-cdk/core": "1.111.0",
        "@serverless-stack/cli": "^0.35.1",
        "@serverless-stack/resources": "^0.35.1",
        "uuid": "^8.3.2"
      }
    (My confusion seems to be around there being two dependencies that make up serverless-stack)
    t
    • 2
    • 5
  • l

    Luke Wyman

    08/30/2021, 5:09 AM
    I may have found a little buggy issue with sst and Python lambdas: • I have a Lambda, called
    KAR_ROT_complete_performance.py
    , which puts a
    PerformanceCompleted
    event on my event bus. Works great, works great, returns a result with
    "FailedEntryCount": 0
    - all good. • Then, I have a Lambda, called
    KAR_HST_add_performance.py
    , that consumes said event and places it in a performance history dynamodb table. • If I do a
    npx sst deploy --stage test
    and then POST to the API to complete a performance, everything works great. No errors in the CloudWatch logs, and I can see my performance in the performance table. So, it works end-to-end with a
    deploy
    . • If I do a
    npx sst start --stage test
    , my
    KAR_ROT_complete_performance.py
    still works well, but my
    KAR_HST_add_performance.py
    throws the following exception in the terminal:
    Copy code
    2d5b30dd-1daa-4bb4-af6b-da4ea4e975cf REQUEST test-karaoke-performance-his-historylogger7C190503-GGOSGWNuWwtH [src/services/performance-history/KAR_HST_add_performance.handler] invoked
    SyntaxError: Unexpected token n in JSON at position 0
        at JSON.parse (<anonymous>)
        at createStrictSyntaxError (/home/lukewyman/Documents/code/karaoke-backend-sst/node_modules/body-parser/lib/types/json.js:158:10)
    • I've also simplified the subscribed lambda so that I'm not trying to do anything at all with the event:
    Copy code
    def handler(event, context):
        print('Inside the add performance handler!')
    and I still get the exception shown above, while also printing
    Inside the add performance handler!
    to to the terminal. So, somehow, the subscribed lambda is falling apart with Live Lambda, but working as expected when deployed.
    f
    • 2
    • 6
  • a

    AdriƔn Mouly

    08/30/2021, 6:10 AM
    I need to reference a function from one stack into other stack, but I can’t share the
    Function
    ?
    f
    j
    • 3
    • 5
  • a

    AdriƔn Mouly

    08/30/2021, 3:30 PM
    I think removing ā€œempty stacksā€ doesn’t work very well. I have 2 ā€œempty stacksā€ which actually are doing a ā€œVPN lookupā€, mostly because I don’t want to create the VPC at the moment. Those are deployed fine now, but I tried removing them and it failed.
    Copy code
    Stack amouly-xxx-vpc-stack
      Status: failed
      Error: The amouly-xxx-vpc-stack stack failed to destroy.
    But removing from CF console works fine.
    t
    • 2
    • 4
  • b

    Blake E

    08/30/2021, 4:35 PM
    Does SST or CDK-pros have any guidance on potentials around ā€œpost deployā€ hooks for scripting additional
    aws-sdk
    work against resources? One limitation with CDK/Cloudform in my experience is the
    sync
    (vs.
    async
    ) nature of it all - it’s the key reason I do love terraform, ability to interrogate deployed resources and use APIs to modify them (outside of the creation). Specifically, I’m looking at some additional SNS Topic properties, which led me to https://stackoverflow.com/a/65703536 (and I’ve verified cloudform still does not support modifying these properties).
    t
    t
    • 3
    • 17
  • p

    Phil Astle

    08/31/2021, 10:47 AM
    Hi all. I'm not sure what's changed but I can't upgrade my stacks past 0.40.1. If I switch to anything higher (I've tried 0.40.2 -0.40.5) I get the following errors:
    Copy code
    RangeError: Maximum call stack size exceeded
        at Object.normalize (path.js:265:12)
        at Object.join (path.js:429:18)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:43:33)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
        at getManager (C:\Users\pa-de\Work\dentr\sst\node_modules\@serverless-stack\core\dist\packager\packager.js:48:12)
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! dentr-sst@0.1.0 deploy: `sst deploy`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the dentr-sst@0.1.0 deploy script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\pa-de\AppData\Roaming\npm-cache\_logs\2021-08-31T10_40_48_799Z-debug.log
    I'm running on Windows 10, if that makes a difference? I also have a stack that has an environment property check around if to determine whether to deploy it or not, like this:
    Copy code
    if (!(skipStatic || isLocal)) {
      new AdminSite(app, `${stackIdPrefix}${AdminSite.STACK_SUFFIX}`);
    }
    Based on one of the bug fixes that went into 0.40.2, about handling empty stacks, I wonder if this could be the issue?
    t
    • 2
    • 5
  • h

    Hubert

    08/31/2021, 12:10 PM
    Hello! I'm trying to recreate a serverless.yaml setup in SST for my WebSockets. In my Yaml file i have the following:
    Copy code
    functions:
      authorizer:
        handler: fn_authorizer.lambda_handler
        runtime: nodejs14.x
      connection-manager:
        handler: fn_connection_manager.lambda_handler
        events:
          - websocket:
              route: $connect
              authorizer:
                name: authorizer
                identitySource:
                  - "route.request.querystring.Auth"
          - websocket:
              route: $disconnect
    This applies the custom authorizer for the $connect route. It's an IAM response. I've noticed that SST does handle IAM authorizer for WebSockets but it doesn't look to handle a custom lambda function to handle the authentication. Is there maybe a CDK solution? Or an SST solution that I'm just missing? My current solution was to deploy the Websockets via SST and then use the above yaml to attach the authorizer and routes. But this solution relies on cloud watch and cloud watch is lacking proper logging for websockets in my experience. note: connection-manager has a python runtime (not that this should change anything but yeah). Thanks
    f
    j
    • 3
    • 5
  • b

    Blake E

    08/31/2021, 4:24 PM
    to confirm, the
    @aws-cdk/assert
    package, and it’s usage in docs like sst provides - is for interrogating the stack template, NOT deployed resources right? My team is writing some integration/e2e tests, and I think it would be nice to have some basic tests that poll/wait for some resources to be available - MAYBE it’s not required, but for completedness I want to confirm this is not behaviour of cdk/assert and/or is not best practice šŸ™ thanks!
    t
    • 2
    • 4
1...101112...33Latest