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

    Adrián Mouly

    08/04/2021, 5:59 AM
    Can not find it but… Is there a way to define Lambda function name? Currently having this:
    Copy code
    pr149-tasks-stack-LambdaDELETEtaskstaskId55457B-Phy8XB3Kr1eU
    m
    f
    • 3
    • 9
  • j

    Josias Duarte Busiquia

    08/04/2021, 11:24 AM
    Does multiple apps with a
    sst.json
    each imply multiple installations of SST?
    f
    • 2
    • 4
  • d

    Drew

    08/04/2021, 10:55 PM
    CDK question 1. I want to add a role to an RDS database, but I manually assigned it. 2. Cloudformation rollsback the stack with the error when I try to add it. 3. I could manually use the console to remove the role, but then my site stops working. 4. Is there a way to tell CDK/Cloudformation that this error is "okay"? 5. (I'm also using the Cfn escape hatch here.. which might be what is making this more fragile)
    t
    d
    f
    • 4
    • 7
  • j

    Jimmy

    08/05/2021, 8:22 AM
    Are there any plans for JVM/Java support?
    t
    f
    +2
    • 5
    • 57
  • f

    Frank

    08/05/2021, 2:21 PM
    C# experts! Can you invoke a function from terminal directly?
    Copy code
    // Function.cs
    
    namespace SampleFunction
    {
        public class Function
        {
            
            public string FunctionHandler(string input, ILambdaContext context)
            {
                return input?.ToUpper();
            }
        }
    }
    ie. I want to invoke 
    FunctionHandler
     from my terminal
    t
    j
    • 3
    • 12
  • m

    Matthew Purdon

    08/05/2021, 3:10 PM
    hey there, I was looking to attach permissions to an existing s3 bucket but it seems like sst.Bucket doesn’t support
    fromBucket[Name|Arn]
    ? I know the general philosophy is to let CDK generate names (especially things that will generate a CW log group) but is there a way to get a handle to an existing bucket?
    f
    • 2
    • 9
  • s

    Sam Hulick

    08/06/2021, 4:41 AM
    just a heads-up: Yarn 2 is very picky about having dependencies properly included in package.json:
    Copy code
    YN0002: │ @aws-cdk/aws-events-targets@npm:1.111.0 [d4661] doesn't provide @aws-cdk/assets (p44201), requested by @aws-cdk/aws-codebuild
    ➤ YN0002: │ testproj@workspace:. doesn't provide jest (pa7e45), requested by @aws-cdk/assert
    ➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
    ➤ YN0000: └ Completed in 6s 410ms
    it doesn’t like the fact that
    jest
    is not in the dependencies. could work in
    peerDependencies
    but maybe better in
    devDependencies
    . so maybe the SST project creation script could include
    jest
    . more info on this: https://dev.to/arcanis/implicit-transitive-peer-dependencies-ed0
    f
    t
    • 3
    • 5
  • n

    Nick Laffey

    08/06/2021, 7:02 PM
    I’m using the
    StaticSite
    construct and deploying and removing was working fine until a few days ago. I’m doing
    sst remove --stage MyStageName
    in a Github action. It’s throwing an error because the path/folder to the distribution files doesn’t exist… But I don’t see why that should matter though if I’m destroying the stack? If I build before destroying it works fine. Am I missing something? Is there a good reason to need to build my static site before destroying or was an issue introduced recently? Again, it seems like this just started happening recently. I’ll see if I can track down whether we did an sst upgrade.
    t
    • 2
    • 21
  • a

    Adrián Mouly

    08/06/2021, 11:21 PM
    Hey guys, I’m following this example to share an API that I’ve created on a main stack, with other stacks: https://docs.serverless-stack.com/constructs/Api#importing-an-existing-http-api
    Copy code
    export class AnotherStack extends Stack {
      constructor(scope: App, id: string, props: AnotherStackProps) {
        super(scope, id, props);
    
        props.api.addRoutes(this, {
          "GET    /notes/{id}": "src/get.main",
          "PUT    /notes/{id}": "src/update.main",
          "DELETE /notes/{id}": "src/delete.main",
        });
      }
    }
    The thing is my “routes” all need to have the same “base path” like…
    Copy code
    /myapp/notes
    And I don’t want to put..
    Copy code
    props.api.addRoutes(this, {
          "GET    /myapp/notes/{id}": "src/get.main",
          "PUT    /myapp/notes/{id}": "src/update.main",
          "DELETE /myapp/notes/{id}": "src/delete.main",
        });
    Is there a way to define the
    path
    for only those routes? I know that I can define the
    path
    when creating the API from scratch with
    customDomain
    , but not sure how to do on this scenario.
    s
    f
    • 3
    • 8
  • a

    Adrián Mouly

    08/07/2021, 7:59 AM
    Question about mono-repo structure: I have a bunch of SLS services that I’m planning to migrate to SST. Now, each of my services have their own
    package.json
    file today, due most of them have totally different dependencies between each other. How is supposed that I can do the same with SST? For example, I have a bunch of lambdas under the
    user
    service that uses the
    jsonwebtoken
    dependency. Of course I don’t want to share that dependency with every other service. Based on mono-repo examples, all shared a
    package.json
    on the root, at the same level as the
    sst.json
    file, then all the projects are built with the same dependencies, I guess. Anybody else has any thoughts?
    t
    f
    +2
    • 5
    • 49
  • r

    Ross Coundon

    08/07/2021, 8:29 PM
    What's everyone's SST build/deploy performance like? The reason I ask is that I have a TypeScript project with 11 functions in it (all but one tied to HTTP API routes, the other an eventbridge cron) and when running
    sst deploy
    it seems to take longer than it should. Running
    tsc
    on the entire project takes about 10s I feel like the Building Lambda function /src/somePath/func.handler stage takes longer than it should. For this project to get from the running
    sst deploy
    to Deploying Stacks takes 11 minutes.
    f
    • 2
    • 6
  • s

    Sakar

    08/08/2021, 8:21 AM
    Hi, Let me know how to Triggering AWS Step Functions by AWS API Gateway Calls in SST
    f
    m
    • 3
    • 9
  • g

    Garret Harp

    08/08/2021, 4:33 PM
    Small suggestion for Cognito/Auth struct: The ability to define groups, domains, and setup ses for emails. For example currently I have to do this if I want to add groups/domains/ses for emails:
    Copy code
    const Cognito = new Auth(this, 'AuthResourceId', {
    	cognito: true
    })
    
    // Enable SES for emails:
    const cfnUserPool = Cognito.cognitoUserPool!.node.defaultChild as CfnUserPool
    cfnUserPool.emailConfiguration = {
    	emailSendingAccount: 'DEVELOPER',
    	replyToEmailAddress: '<mailto:email@example.com|email@example.com>',
    	from: '<mailto:email@example.com|email@example.com>',
    	sourceArn: 'arn:something'
    }
    
    // Create domain for UserPool:
    new CfnUserPoolDomain(this, 'DomainResourceId', {
    	userPoolId: Cognito.cognitoUserPool!.userPoolId,
    	domain: 'some-domain'
    })
    
    // Add a group:
    new CfnUserPoolGroup(this, 'GroupResourceId', {
    	userPoolId: Cognito.cognitoUserPool!.userPoolId,
    	groupName: 'GroupName',
    	precedence: 0
    })
    Would be really nice if I could just do something similar to this:
    Copy code
    const Cognito = new Auth(this, 'AuthResourceId', {
    	cognito: {
    		userPool: {
    			domain: 'some-domain',
                groups: [{ id: 'ResourceId', groupName: 'GroupName', precedence: 0 }],
                emailConfiguration: {
                    emailSendingAccount: 'DEVELOPER',
                    replyToEmailAddress: '<mailto:email@example.com|email@example.com>',
                    ...
                }
    		}
    	}
    })
    f
    • 2
    • 3
  • l

    Luke Wyman

    08/09/2021, 4:59 AM
    So, since my happy little sst app is a skills exposition project, I'm considering writing one of my microservices in Python (The rest is in Typescript). My project uses the monorepo with Lerna, blah, blah template. I've already experimented briefly with
    npx create-serverless-stack@latest [project name] --language python
    . Some thoughts on this: • The above creates a hybrid of Javascript sst code, Javascript sst tests for
    MyStack.js
    , and Python for the lambdas. The usual package.json, etc. • Where/how are the Python dependencies needed in my Lambdas managed (since I'm seeing node stuff everywhere else)? • What happens when I run
    npx sst test
    ? I know Jest is a part of serverless stack, so what happens with whatever Python testing framework I'll end up using (for domain object unit tests)? Does the test command detect that and respond accordingly, or do I have to wire that up? Or, do I just run a separate command to run the Python tests? • My guess is that sst knows how to bundle and deploy Python Lambdas by detecting the
    .py
    extension. • Integration tests can still still be in typescript, since that's what they are for my typescript microservices and don't intrude into the guts of my Lambdas.
    f
    • 2
    • 8
  • s

    Sam Hulick

    08/09/2021, 9:48 PM
    just a heads-up: these errors/warnings are a bit confusing. it’s not clear where in my code it’s referring to since there’s no filename shown and no actual code/variables shown either
    Copy code
    [dotenv][DEBUG] did not match key and value when parsing line 1: # These variables are only available in your SST code.
    [dotenv][DEBUG] did not match key and value when parsing line 2: # To apply them to your Lambda functions, checkout this doc - <https://docs.serverless-stack.com/environment-variables#environment-variables-in-lambda-functions>
    [dotenv][DEBUG] did not match key and value when parsing line 3:
    [dotenv][DEBUG] did not match key and value when parsing line 7:
    f
    • 2
    • 7
  • a

    Adrián Mouly

    08/10/2021, 5:56 AM
    Hey guys, I’m trying to implement AWS_IAM auth for some of my endpoints. Found that I can do that, but how I should CONSUME these resources? For example my
    API One
    it’s defined with IAM auth, and then must be consumed by
    Service Two
    .. how should I setup
    Service Two
    to send the proper authentication? I’m lost on this, can’t find examples of it.
    s
    a
    +2
    • 5
    • 29
  • j

    Jay

    08/10/2021, 12:48 PM
    It would be cool if somebody can chime in with their experience here https://twitter.com/paulswail/status/1425020045273583624?s=21
    a
    d
    • 3
    • 4
  • l

    Lukasz K

    08/10/2021, 1:43 PM
    Hey there fellow SSTers, I've heard there was an update recently that helps you ignore some stacks when running local debug session. I've got static site deployment stack that is in dire need of being ignored but can't actually find the patch notes related... Any help will be appreciated
    t
    f
    t
    • 4
    • 23
  • k

    Kujtim Hoxha

    08/10/2021, 2:58 PM
    Hi, I am trying to use golang for some of my functions and I think I found an issue with how the CLI handles the
    cwd
    here I think if the
    srcPath
    is defined in the function props this should be changed to the
    srcPath
    instead of
    root
    the reason for this is that
    go
    does not find the
    go.mod
    file and does not compile the code.
    t
    • 2
    • 11
  • d

    David Martin

    08/10/2021, 9:11 PM
    What do you think about adding GraphQL schema validation to the AppSyncApi construct so that errors cause it to fail locally instead of waiting a few minutes for it to be deployed to AWS and getting the error there. The code should be pretty simple:
    const parseSchema = require("graphql/language").parse;
    try {
    parseSchema(graphQLSchemaAsString);
    } catch (e) {
    // parse failed
    }
    t
    f
    • 3
    • 10
  • s

    Sam Hulick

    08/11/2021, 3:44 AM
    hey guys, weird bug going on with Yarn workspaces & SST. easy to reproduce.. this is my package.json at the root level of my test monorepo:
    Copy code
    {
      "name": "v2-microservices",
      "version": "0.1.0",
      "private": true,
      "workspaces": [
        "src/services/*"
      ],
      "dependencies": {
        "@serverless-stack/cli": "^0.37.2"
      }
    }
    when I run
    yarn
    , I see a node_modules folder pop up in
    src/services/mytest/
    which I don’t think is supposed to happen. no other dependencies do this.. if I remove the SST CLI package and install a bunch of other stuff, it’s fine. I’ve let one of the Yarn 2 maintainers know. not sure if this bug exists in Yarn 1
    f
    • 2
    • 10
  • a

    Ashishkumar Pandey

    08/11/2021, 6:10 PM
    Would live lambda development work if I deploy a stage via seed and then start it locally via
    npx sst start
    . When I attempt this, my requests work but they don’t get logged in the console and my changes also don’t get reflected.
    f
    a
    • 3
    • 29
  • r

    Ross Coundon

    08/11/2021, 9:28 PM
    Is there any guidance on setting up live debugging with WebStorm? One of my team prefers it over VSC and couldn't get it working and I have never used it so couldn't really help
    f
    • 2
    • 3
  • a

    Adrián Mouly

    08/11/2021, 11:39 PM
    Quick question… I want to use HTTP Proxy routes… Is it possible to use path variables? Like.. I want to map this…
    /projects/{projectId}
    ->
    <http://google.com/projects/{projectId}|google.com/projects/{projectId}>
    a
    f
    • 3
    • 5
  • s

    Sam Hulick

    08/12/2021, 4:01 AM
    quick bug in the docs:
    environment
    is missing in the Properties on the right sidebar. https://docs.serverless-stack.com/constructs/Function
    f
    a
    • 3
    • 14
  • a

    Ashishkumar Pandey

    08/13/2021, 10:09 AM
    npm audit reports some vulnerabilities -
    Copy code
    ❯ npm audit                                                                                      
    # npm audit report
    
    jszip  <3.7.0
    Severity: moderate
    Prototype Pollution - <https://npmjs.com/advisories/1774>
    fix available via `npm audit fix --force`
    Will install @serverless-stack/resources@0.4.5, which is a breaking change
    node_modules/jszip
      zip-local  *
      Depends on vulnerable versions of jszip
      node_modules/zip-local
        @serverless-stack/resources  >=0.5.0
        Depends on vulnerable versions of zip-local
        node_modules/@serverless-stack/resources
          @serverless-stack/cli  >=0.5.0
          Depends on vulnerable versions of @serverless-stack/resources
          node_modules/@serverless-stack/cli
    
    4 moderate severity vulnerabilities
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    this is for 0.38.0
    f
    • 2
    • 2
  • k

    Kujtim Hoxha

    08/13/2021, 10:44 AM
    Hi, I tried to add a lambda layer to all of my functions using
    app.setDefaultFunctionProps
    but it looks like you can only do that within the context of a stack, I think there should be an easier way to add lambda layers for all functions in all my stacks (I ended up just adding it to one of the stacks that the others are dependent on)
    f
    j
    • 3
    • 31
  • p

    Phil Astle

    08/13/2021, 10:49 AM
    Hit a bit of an issue with using a lambda function default authorizer on an ApolloApi stack. The first time I try to use the graph api, the request works. Subsequent times fail (500 response) until after a fixed period of time, in which case one more request works and then subsequent calls fail. After some digging around we worked out that setting the authorization cache TTL to 0 fixed this. However, we'd quite like to use the authorization caching so this seems like a temporary fix... I tried adding breakpoints in our code to work out where the 500 was coming from but it didn't hit any. The issue appears to be elsewhere but I've no idea where. A colleague of mine had a similar issue with a Serverless (non-SST) stack a while ago, which is how he thought to try this fix. He never worked out how to get around the issue without disabling the caching like this. Any idea how to get this working with SST?
    f
    • 2
    • 15
  • s

    Sam Hulick

    08/13/2021, 7:29 PM
    it would be awesome if SST neatly handled source map output for us, so we don’t have to write our own solutions (esbuild plugins, etc). in other words, when I deploy code/services (not the stacks), it’s all written to a folder w/ the exact same folder hierarchy, and
    .js
    and
    .js.map
    files are written there. that way it’s super easy to just upload those to Sentry/wherever in one shot
    j
    a
    f
    • 4
    • 4
  • d

    David Martin

    08/13/2021, 7:45 PM
    Feature request: be able to deploy a single function at a time. Also, be able to deploy a single direct lambda function that lives within appsync too. Similar to this; https://www.serverless.com/framework/docs/providers/aws/cli-reference/deploy-function/
    t
    r
    +3
    • 6
    • 23
1...8910...33Latest