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

    Blake E

    09/30/2021, 4:12 PM
    with Graviton2 processors arriving, I’m stoked to see https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-readme.html#architecture supported by sst so we can play 😉 ie. cdk 1.125.0 https://github.com/aws/aws-cdk/releases/tag/v1.125.0
    t
    • 2
    • 1
  • c

    Clayton

    09/30/2021, 4:42 PM
    This has been asked & answered in a couple of contexts, but I can’t yet see the underlying principles for when it makes sense to create separate stacks – and how these should correlate to services. I’d like to create an architecture that is - • event-first, with autonomous services that communicate async through tools like EventBridge • allows services to be developed and deployed independently/safely of one another This seems to suggest that each service should have its own stack, with some stacks serving common resources (e.g. an Event Hub). Would this near 1:1 service:stack approach be too granular or expensive in effort/costs? Is there a better way to achieve the independence of services above that also consolidates or simplifies the infrastructure stacks?
    t
    j
    t
    • 4
    • 7
  • e

    Erik Robertson

    09/30/2021, 4:45 PM
    Probably is a newbie question but I'm ussing SST along with Prisma and PlanetScale to build an API. So far everything is working fine locally. However after running deploy and hitting the API in prod, I'm getting this error :
    021-09-30T15:29:23.784Z	a0688053-70ec-41c5-a480-13b3218dad0a	ERROR	Invoke Error
    { "errorType": "Error", "errorMessage": "ENOENT: no such file or directory, open '/var/task/src/schema.prisma'", "code": "ENOENT", "errno": -2, "syscall": "open", "path": "/var/task/src/schema.prisma", "clientVersion": "3.1.1", "stack": [ "Error: ENOENT: no such file or directory, open '/var/task/src/schema.prisma'", " at Object.openSync (fs.js:462:3)", " at Object.readFileSync (fs.js:364:35)", " at new LibraryEngine (/var/task/src/list.js:28474:46)", " at PrismaClient2.getEngine (/var/task/src/list.js:40879:20)", " at new PrismaClient (/var/task/src/list.js:40848:33)", " at Function.getClient (/var/task/src/list.js:41844:12)", " at Runtime.main [as handler] (/var/task/src/list.js:41853:17)", " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" ] }
    Since then I've read here that Prisma needs a Lambda layer for it to work properly. So I'm assuming that could be causing that error. But even looking at various snippets mentioned on this Slack I haven't managed to get the layer to build (getting some error 'execSync' is not defined, etc...). Is there a working sample or step by step guide I could look at ?
    g
    f
    • 3
    • 10
  • c

    Clayton

    09/30/2021, 7:47 PM
    It looks like when you update stack names and then ‘redeploy infrastructure’ in SST local dev - 1. new stacks are deployed with new stack names (expected) 2. original stacks with the prior names remain in CloudFormation (un-expected) Is 2 intentional and something you need to remove manually or is there another way these are cleaned-up later?
    a
    • 2
    • 7
  • b

    Blake E

    09/30/2021, 8:47 PM
    Has anyone been trying to use yarn2 with SST? the hoist changes seems to be causing issues (reminds me of my experience when using
    pnpm
    )
    t
    j
    • 3
    • 10
  • j

    Jack Fraser

    09/30/2021, 10:11 PM
    My VSCode debug get stuck, alot! The first couple of attempts to hit the endpoint after hitting ▶️ on debugger results in the request being dropped. Then it will work for a few few requests then it bomb. If I put a breakpoint in the code it will hit it after a couple of attempts then when it does it let me step through OK, but thats is it - it then wont debug again, to the extent I need to restart vs code or my mac to get it to debug again. Driving me slightly nuts. I am hoping it just a config issue. This is just when debugging two pretty simple API stacks. I also often get "Extension host terminated unexpectedly” and other vs issues. I have disabled all plugins but to no help. Any pointers welcome.
    f
    • 2
    • 3
  • c

    Clayton

    10/01/2021, 3:11 PM
    When I try to implement the SST WebSocket example I receive a logging permission error –
    Copy code
    CREATE_FAILED | AWS::ApiGatewayV2::Stage | ApiStage4697DF29 CloudWatch Logs role ARN must be set in account settings to enable logging (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: d4c744ab-4f22-41fc-91dc-f9e4101fa39c; Proxy: null)
    I can resolve this if I add
    accessLog: false
    to the WebSocket construct, but am wondering - • what’s the consequence of disabling these logs?  • is this just a mismatch between the IAM user policies SST has you create initially and what this construct expects/needs by default?
    t
    f
    • 3
    • 10
  • p

    Patrick J

    10/01/2021, 4:20 PM
    Hey folks, I’m trying to get lambda authorizer to work. The SST is creating it, but whenever I try to access API is says unauthorized, and there are no invocations in the lambda authorizer. Do you have any idea what can be the cause?
    g
    • 2
    • 3
  • c

    colin

    10/01/2021, 5:13 PM
    Hey all, has anyone setup an authorized
    ApolloApi
    to allow requests from multiple user pool clients?, we have one setup with the property
    defaultAuthorizer
    (client facing apps) but I’m wondering if theres a way to allow for another client to get authorized in our case an admin api
    f
    • 2
    • 2
  • p

    Patrick J

    10/01/2021, 5:57 PM
    One more authorizers question: with lambda authorizers - is the somehow response cached? I changed authorizer response, SST says - deployed, but still getting old response.
    g
    • 2
    • 2
  • a

    Adrián Mouly

    10/02/2021, 9:41 PM
    Hey guys, I’m using Lerna + Yarn, and had to disable hoisting due I’m having some issues with my React apps. I’m trying some things to get this resolved. But once I disable hoisting, I’m getting the follwing error:
    Copy code
    SST: 0.44.0
    CDK: 1.124.0
    Using stage: dev
    Preparing your SST app
    Detected tsconfig.json
    Transpiling source
    Linting source
    Error: Cannot find module 'eslint'
    Require stack:
    - /Users/xxx/Projects/xxx/xxx-serverless/.build/eslint.js
    t
    • 2
    • 18
  • g

    Garret Harp

    10/03/2021, 6:22 PM
    Is there anyway so set which aws profile to use from the credentials file without having to set it every time before you run the start command? I tried setting AWS_PROFILE in
    .env.local
    but it says credentials missing whenever I start. Possibly a "profile" file in
    .sst
    like you do with stage if the default credentials are empty?
    r
    t
    +2
    • 5
    • 20
  • a

    Abdul Taleb

    10/04/2021, 3:30 AM
    Is there a plan for the
    ApolloApi
    construct to support the default healthcheck endpoint? https://www.apollographql.com/docs/apollo-server/monitoring/health-checks/. If there is, will it have the option to bypass authentication or customize authentication?
    f
    • 2
    • 6
  • l

    Luke Wyman

    10/04/2021, 3:46 AM
    Hey @Frank - just an update on the python packaging thing. It looks like it's quite doable. What I did manually (raw without sst): • followed the aws documentation to do a
    zip -r ../../../../src/my-deployment-package.zip
    from inside my
    lib/python3.8/site-packages
    in my virtual environment (does the same thing as requirements.txt) • then ran over to the
    handlers
    directory and did a
    zip -g getter.py
    to add my Lambda handler • then did a
    python3 -m build
    inside
    libs
    to build my wheel file, then a
    wheel unpack [package name]
    inside
    dist
    (created by the
    build
    ), cd'd into that directory and did another
    zip -r my-deployment-package.zip .
    to add the decompressed wheel contents (a wheel behaves just like a zip) to the deployment package. • deployed the zip, and it worked with package names like
    rest_helper.rest_helper
    . What this could look like as an sst implementation (maybe a construct kind of thing like script, or better yet, a property of
    defaultFunctionProps
    like
    srcPath
    is currently for Python projects? ) The big deal here is getting custom
    libs
    packages into the docker container at image build time: • specify a
    libs
    folder in your sst/cdk code in the construct (there could be multiple
    libs
    -style folders, depending on monorepo size and complexity) • either the developer does there own
    python3 -m build
    to make a package manually (although you'd have to remember to do this before each
    npx sst deploy
    if you changed your lib code). Or, what I'm more inclined to do, is have sst do the build each time. The
    libs
    folder supplied would have to have a
    setup.cfg
    and
    pyproject.toml
    for this to work (whether manual or automated). • then, sst would "remember" and copy any wheel(s) to the docker container and install it (probably after doing the standard
    requirements.txt
    install): ◦
    COPY dist/[wheel package name].whl .
    ◦
    RUN  pip3 install --no-index --find-links=./ [wheel package name].whl --target "${LAMBDA_TASK_ROOT}"
    • it would be up to the developer to run a
    pip install -e .
    inside the
    libs
    folder so that the tests can see the packages under test using the virtual environment.
    pip install -e .
    installs a virtual link to the
    libs
    folder so that the lambdas can see the packages in the IDE, and so that pytest can see the same packages at test time. Any code changes are detected without any rebuilds or reinstalls.
    f
    • 2
    • 12
  • r

    Ross Coundon

    10/04/2021, 11:38 AM
    @thdxr A while back we were talking about using
    app.setDefaultFunctionProps
    in the context of setting VPC settings and security groups. The securityGroups property is readonly on sst.FunctionProps so I was getting around this by defining my own type where it was writeable. From memory I think you were going to have a look at why it was readonly in the base CDK class to determine if this was safe to do. Did I remember that right? If so, did you get a chance to look into it?
    t
    • 2
    • 3
  • t

    Tyler Flint

    10/04/2021, 3:35 PM
    is it possible to configure esbuild to minimize?
    t
    • 2
    • 13
  • t

    Tyler Flint

    10/04/2021, 3:54 PM
    also it appears
    source-map-support
    isn’t working either. I’m wondering if that’s because it separates the sourcemap from the code during build, instead of inlining it?
    t
    • 2
    • 17
  • t

    Tyler Flint

    10/04/2021, 5:32 PM
    uh oh, found another bug
    Copy code
    Error: Cannot find the esbuild config file at "/Users/tylerflint/Code/tylerflint/serverless-app-template/Users/tylerflint/Code/tylerflint/serverless-app-template/config/esbuild.js"
    t
    f
    • 3
    • 61
  • s

    Sam Hulick

    10/05/2021, 1:05 AM
    hey guys, you might want to put log retention on the debug stack stuff. I noticed there is none, and it seems like they could get huge. the largest one is 56MB so far
    t
    f
    • 3
    • 2
  • d

    David Martin

    10/05/2021, 4:03 AM
    just updated to 0.45.0 and i’m getting this new error. anybody else?
    t
    r
    • 3
    • 8
  • m

    Michael Orcutt

    10/05/2021, 5:54 PM
    Hey there, does anyone have a pattern for running sql migrations as part of the deploy process? We run a Aurora Serverless Postgres DB and would love to run db migrations from our SST app
    t
    p
    • 3
    • 7
  • t

    Tyler Flint

    10/05/2021, 8:54 PM
    ugh, running into another issue where the config is being mutated for custom configs, this time with `sst start`…
    t
    • 2
    • 14
  • r

    Ross Coundon

    10/06/2021, 9:55 PM
    Also, is there a way to import an existing user pool and identity pool to form an Auth construct?
    f
    c
    • 3
    • 60
  • a

    Aurelien Negrier

    10/07/2021, 10:11 AM
    Hey there, does anyone know how to activate sst auto deploy localy when
    schema.graphql
    file is modified ? Actually when I change my
    schema.graphql
    I have to stop sst localy and restart
    sst start
    command
    m
    t
    f
    • 4
    • 6
  • m

    Mike McCall

    10/07/2021, 2:18 PM
    We started using conflict detection in appsync. CDK doesn't provide this option in the L2 constructs yet so we are building our own. This would be a nice addition to sst appsync construct.
    t
    • 2
    • 1
  • r

    Ross Coundon

    10/07/2021, 7:57 PM
    I'm trying to add epsagon as a layer instead of wrapping all my functions. I'm using
    Copy code
    const epsagon = LayerVersion.fromLayerVersionArn(this, 'EpsagonLayer', process.env.EPSAGON_LAYER_ARN);
        this.addDefaultFunctionLayers([epsagon]);
        this.addDefaultFunctionEnv({
          EPSAGON_TOKEN: process.env.EPSAGON_TOKEN,
          EPSAGON_APP_NAME: process.env.EPSAGON_APP_NAME,
          NODE_OPTIONS: '-r epsagon-frameworks',
        });
    I can see that all the necessary env vars are getting set. However, and everything deploys okay with
    sst start
    but when executing a function it fails and I can see a log in Cloudwatch that says:
    Copy code
    internal/modules/cjs/loader.js:892
    throw err;
    ^
    Error: Cannot find module 'epsagon-frameworks'
    Require stack:
    - internal/preload
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1231:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:468:5)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:71:3)
    at internal/main/run_main_module.js:7:1 {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'internal/preload' ]
    }
    a
    f
    t
    • 4
    • 50
  • l

    Lukasz K

    10/08/2021, 10:27 AM
    Hey @Frank @thdxr what's the ETA for CDK v1.126.0 support? Just got an email from AWS where they've identified a bug regarding the removal policy of S3 buckets (namely auto_delete_objects setup being ignored in some cases).
    t
    f
    • 3
    • 7
  • r

    Ross Coundon

    10/08/2021, 10:41 AM
    I'm seeing a problem with connecting a live debug or
    sst start
    session with the app I'm migrating to SST. When calling a function via API Gateway or via a Cognito hook, it returns a 500 Internal Server Error and I see this in logs (apologies for screenshot, it's spread over many lines so difficult to copy/paste). The lambdas aren't in a VPC. Any thoughts on what could be going on?
    f
    t
    • 3
    • 25
  • a

    Adrián Mouly

    10/08/2021, 5:04 PM
    Looks like SST/CDK is creating a bunch of CName records on Route 53 for stage-subdomains, like, for each PR or developers’ stage. Is there a way to clean this from CDK/SST?
    t
    b
    f
    • 4
    • 36
  • b

    Blake E

    10/08/2021, 5:10 PM
    @Frank Hey, just upgraded to 0.44.1 that included you fix for me, which almost worked, but I think b/c I have my NextJsSite deployed in another region already I’m getting a name collision issue with Cloudfront
    f
    • 2
    • 12
1...141516...33Latest