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

    Francis Menguito

    05/30/2022, 1:08 PM
    In which channel can we ask about how to implement something?
    t
    a
    k
    • 4
    • 13
  • d

    Danny Rivadeneira

    05/30/2022, 2:15 PM
    hello everyone I have a doubt, I want to create a dynamo stream from the code where I configure my stack, but the dynamo table is a table that was not created with sst-framework, I tried to do it like this and add the stream from that configuration https://docs.serverless-stack.com/constructs/v0/Table#importing-an-existing-table but it gives me error because it tries to create a new table and it is not what I want, I want to know how I can add my stream to a dynamo table created from the aws console from my stack configuration.
    s
    k
    +2
    • 5
    • 11
  • k

    Kenny

    05/30/2022, 7:02 PM
    In this chapter of the tutorial https://serverless-stack.com/chapters/secure-our-serverless-apis.html They tell you to make a curl request to test the auth. This is what my curl req looks like
    Copy code
    npx aws-api-gateway-cli-test --username <mailto:test@gmail.com|test@gmail.com> --password 12345Foo! --user-pool-id us-east-1_I8XLnM67Q --app-client-id 44hqn436m45aa92j9vkh7pjdfn --cognito-region us-east-1 --identity-pool-id us-east-1:966cd055-29d0-4f48-ba65-3326cf9dea63 --invoke-url <https://d8cdv8pdh4.execute-api.us-east-1.amazonaws.com> --api-gateway-region us-east-1 --path-template /notes --method POST --body "{\"content\":\"h\",\"attachment\":\"h.jpg\"}"
    But I get an error saying
    {\ SyntaxError: Unexpected token \ in JSON at position 1
    I have even tried this
    Copy code
    npx aws-api-gateway-cli-test --username <mailto:test@gmail.com|test@gmail.com> --password 12345Foo! --user-pool-id us-east-1_I8XLnM67Q --app-client-id 44hqn436m45aa92j9vkh7pjdfn --cognito-region us-east-1 --identity-pool-id us-east-1:966cd055-29d0-4f48-ba65-3326cf9dea63 --invoke-url <https://d8cdv8pdh4.execute-api.us-east-1.amazonaws.com> --api-gateway-region us-east-1 --path-template /notes --method POST --body '{"content":"d","attachment":"hello.jpg"}'
    r
    f
    +2
    • 5
    • 49
  • k

    Klaus

    05/30/2022, 7:44 PM
    I'm wondering about the right way to remove a customized debugApp stack while keeping the deployed App stack. For background this would be a scenario, where the test phase (started with
    npm run start
    has been completed and the stage was deployed with
    npm run deploy
    The doc mentions that stacks can be removed individually by providing the stack name as parameter. However, this seems to fail for me in case of my customized debugApp stack.
    r
    f
    • 3
    • 10
  • d

    Devin

    05/30/2022, 11:12 PM
    I’m pretty sure I’ve been running
    Copy code
    npx sst start
    in my app all this time. That recently stopped working and now I’m using
    npm run start
    My npx command outputs…
    Copy code
    ➜  frontend git:(main) ✗ npx sst start
    npx: installed 1 in 0.465s
    command not found: sst
    npm run start seems to work but this is a surprising result.
    t
    • 2
    • 4
  • c

    Carlos Daniel

    05/31/2022, 12:11 AM
    can I import lambdas created outside CDK as CDK resources? I searched a tad but didn’t find anything
    j
    f
    • 3
    • 3
  • h

    Hazel

    05/31/2022, 12:19 AM
    Hi folks, I need to use my
    x-api-key
    value for accessing the Graphql playground of my AppSync instance, through the SST console. I’m using v1 of SST. Can you please tell me how to find this value? I’m not seeing it anywhere in the documentation.
    f
    • 2
    • 1
  • j

    justindra

    05/31/2022, 1:15 AM
    Hey all, just wondering how the ENV variables are being injected in at the start of the StaticSite Builds? It looks like it's not pushing it into
    expo build:web
    and when I print out the ENV, I just get the following instead of it being filled properly.
    Copy code
    REACT_APP_COGNITO_USER_POOL_ID: '{{ REACT_APP_COGNITO_USER_POOL_ID }}',
      REACT_APP_AWS_REGION: 'us-west-2',
      REACT_APP_API_ENDPOINT: '{{ REACT_APP_API_ENDPOINT }}',
    The defn:
    Copy code
    new StaticSite(this, 'ClientApp', {
        path: 'frontend/client',
        buildOutput: 'web-build',
        buildCommand: 'npm run build:web',
        errorPage: 'redirect_to_index_page',
        environment: {
          REACT_APP_AWS_REGION: scope.region,
          REACT_APP_COGNITO_USER_POOL_ID: this.auth.userPoolId || '',
          REACT_APP_COGNITO_USER_POOL_CLIENT_ID: this.auth.userPoolClientId || '',
          REACT_APP_API_ENDPOINT: this.api.url,
          REACT_APP_COGNITO_DOMAIN: rootDomain,
        },
      });
    f
    • 2
    • 4
  • d

    Daniel Gato

    05/31/2022, 9:31 AM
    I have a StaticSite that is a simple HTML page. I’m defining 2 environment variables on my StaticSite and I have
    disablePlaceholder: true
    set. What would be the easiest to get those variables replaced on sst start and sst deploy? Isn’t there a native way for SST to replace it. The documentation mentions
    {{ MY_VAR }}
    but I tried and it doesn’t get replaced.
    t
    • 2
    • 5
  • t

    T Indie

    05/31/2022, 11:14 AM
    Migration to V1: is there a way to migrate without having to rename, because after upgrading I cant run sst dev or deploy it fails with
    Status: failed
    Error:  already exists in stack arn:aws:cloudformation:
    t
    • 2
    • 3
  • f

    Francis Menguito

    05/31/2022, 12:37 PM
    Is it possible for Lambda functions to perform redirects?
    t
    • 2
    • 4
  • e

    Edward Asquith

    05/31/2022, 12:55 PM
    When the bot announces new releases, it says we can run:
    Copy code
    yarn sst update v1.2.12
    What does this actually do? For me, I get some console printing but no change to package.json:
    Copy code
    % yarn sst update v1.2.12
    Updating @serverless-stack/cli to v1.2.12
    Updating @serverless-stack/resources to v1.2.12
    Updating aws-cdk-lib@2.24.0
    SST: 1.2.11
    CDK: 2.24.0
    t
    • 2
    • 5
  • f

    Francis Menguito

    05/31/2022, 1:26 PM
    Is there a sample of a login lambda that generates a JWT based on my cognito user pool? This is given that my frontend is outside of SST
    t
    d
    +2
    • 5
    • 31
  • s

    sforman

    05/31/2022, 3:01 PM
    because if I do
    Copy code
    const stream = new KinesisStream(stack, "Stream", {
        consumers: {
          consumer1: {
            function: {
              handler: "functions/lambda.handler",
              timeout: 5,
              retryAttempts: 5
            },
          },
        },
      });
    with the function that will timeout
    Copy code
    export const handler: any = async (event) => {
      console.log("Run");
      await sleep(20000);
    };
    
    function sleep(ms) {
      return new Promise((resolve) => {
        setTimeout(resolve, ms);
      });
    }
    it times out, but doesn't retry - same goes for throwing errors, no retry
    c
    f
    • 3
    • 2
  • m

    Miguel

    05/31/2022, 4:13 PM
    Hi, I’m creating a
    AppConfig stack
    which will need to access every other stack’s output values. The only way I see to do this with SST is by returning the outputs in every stack, then importing them all one by one in the
    AppConfig
    stack and then accessing the exported values. Is there any way to make this dynamic like accessing every stack deployed from a loop inside the AppConfig stack? My intention is to create a configuration with certain values from each stack so it can be used later from Lambda functions and such
    t
    • 2
    • 11
  • e

    Ekansh Vinaik

    05/31/2022, 5:13 PM
    hey all! just joined 🙂 Got an interesting situation after updating Serverless v2 -> v3 on Seed. Here’s the timeline: 1. updated serverless yml configs to v3 following migration guide 2. deployed to seed, which caused a CloudFormation stack conflict error for 2 of 13 deployments a. fixed this by deleting the CloudFormation stack and redeploying b. this seemingly worked fine on our dev deployments 3. did the above steps for production 4. couple bad things happening now: a. Issues tab no longer shows errors for 1 of those 2 deployments (in spite of there being errors thrown, exactly as they were previously) b. Resources tab claims that there are no Lambdas deployed in the same API (see attached picture) we’re wondering how we can bring this back into sync, as we rely on Seed Issues for a quick and dirty overview of issues for our app. if that’s not easy to communicate, I’m wondering how to debug this issue at all? kind of at a loss here
    f
    • 2
    • 23
  • p

    Paul

    05/31/2022, 5:33 PM
    Hey everyone, are there any examples or best practices for building large HTTP-Apis using a single domain? At the moment I have one stack with multiple
    ApiGatewayV1Api
    apis that are all using the same imported domain (using
    DomainName.fromDomainNameAttributes
    ) and have different base paths. But I am approaching the 500 resources limit and when I tried to split the stack up into multiple stacks (e.g. one stack per
    ApiGatewayV1Api
    ) the domain is always only working for one the stacks (deploy works but lambdas cannot be reached). So what are the best practices to structure a case like this and are there any changes to sharing domains in v1 (I am still using 0.69)?
    t
    f
    • 3
    • 3
  • j

    Jasjit

    06/01/2022, 12:49 AM
    Hi Everyone, this might be a silly question, but was just wondering if anyone out there has developed a complete SaaS solution using SST? Are there any boilerplates or templates available? Ideally the auth and payment are already pre-baked, and I'd be able to focus on the app functionality.
    t
    d
    j
    • 4
    • 21
  • c

    Chris Laplante

    06/01/2022, 2:04 AM
    Hello, is it possible to add an Alexa trigger to my lambda function created using sst? In normal Serverless it's one line of yaml: https://www.serverless.com/framework/docs/providers/aws/events/alexa-skill
    f
    • 2
    • 27
  • h

    heyysaiii

    06/01/2022, 4:31 AM
    Hey everyone, I have a query to verify an user in aws cognito. Like if a user (signed via fb/google) already exists then redirect them to login. I have used the following function for that.
    const existingUser = await cognito.send(
    new AdminGetUserCommand({
    UserPoolId: config.cognito.USER_POOL_ID,
    Username: user.email,
    })
    ); if (exisitingUser) {}
    But seems like it doesn't work. Can someone please help me with this?
    f
    g
    • 3
    • 5
  • l

    Luke Stock

    06/01/2022, 9:48 AM
    I am trying to run the latest version of https://github.com/serverless-stack/demo-notes-app on Windows 11 and it fails to build. When I run
    npx sst start
    I get the following error:
    Copy code
    Preparing your SST app
    X [ERROR] The entry point "C:\\...\\sst-demo-notes-app\\stacks\\index.js" cannot be marked as external
    
    Build failed with 1 error:
    error: The entry point "C:\\...\\sst-demo-notes-app\\stacks\\index.js" cannot be marked as external
    This previously worked before the commit to "Update SST to v1". Any help will be greatly appreciated. Luke
    k
    t
    • 3
    • 20
  • e

    Edward Asquith

    06/01/2022, 1:30 PM
    Hey all. I’m working in a multi-account environment, and trying to deploy from a CI runner in a build account to one of several target accounts (say develop, staging, production). I’m trying to move away from using AWS profiles due to general problems with support for EC2InstanceMetadata and the need to drop that config into the environment. CDKv2 Bootstrap creates lookup and deployment roles in the target environments, so I figured I could
    --trust
    the build account and set IAM to allow the CI runner to assume these roles. All good so far. However, when I set
    --role-arn
    and
    --region
    during SST deployment it still tries to deploy into the build account - which figures. So I tried setting the stack
    env
    which in CDK allows me to specify the target account and region (which I can do based on stage name). This fails thusly:
    Copy code
    Error: Do not set the "env" prop while initializing "teams" stack ({"region":"eu-west-2","account":"<redacted>"}). Use the "AWS_PROFILE" environment variable and "--region" CLI option instead.
    That looks like a different behaviour from stock CDK (I presume for some good reason). Am I at a dead end? Could be that I’ve misunderstood the purpose of CDK bootstrapping as I’m trying to use it for the first time, but it makes it look like I have to use AWS_PROFILE in practice, rather than assuming a bootstrapped role in the target account.
    f
    • 2
    • 6
  • k

    Karolis Stulgys

    06/01/2022, 3:42 PM
    👋 I don't know if this is related to SST at all but I run into this issue when using prisma in SST lambda and try to create a user:
    Copy code
    Failed to validate the query: `Field does not exist on enclosing type.` at `Mutation.createOneCustomer`
    I have tried various thing from suggestions from internet (switching node version, switching prisma version, reinstall deps etc.) but nothing worked. Anyone by any chance run in to this before?
    Copy code
    model Customer {
      id           String         @id @unique
      createdAt    DateTime       @default(now())
      updatedAt    DateTime       @updatedAt
      customerId   String         @unique
      subscription Subscription[]
    }
    g
    • 2
    • 1
  • k

    Kelly Davis

    06/01/2022, 5:36 PM
    I am attempting to update from 0.53.0 -> 0.54.0 (and eventually to 1.x) and running into an issue with this error:
    ERROR build_failure: The function [FUNCTION_NAME] failed to build
    when I invoke the associated endpoint. It is a Go lambda. I have the sst.json at the root of my repo, and then the go code is in a subfolder "foo". The srcPath prop is set to "foo". Any ideas?
    f
    • 2
    • 38
  • k

    Kenny

    06/01/2022, 9:10 PM
    There are two tutorials for adding Facebook auth. Which one should I follow??
    f
    • 2
    • 7
  • a

    arda

    06/01/2022, 9:38 PM
    Hi guys, I am calling amazon translate service in lambda function and it requires a
    DataAccessRole
    for the translate service to access S3. How would you create such role? Do you create it in stack creation step and pass it in as a env var or create it in the lambda function?
    f
    • 2
    • 1
  • k

    Kenny

    06/01/2022, 11:15 PM
    Copy code
    aws cognito-identity get-id --identity-pool-id us-east-1:c007ebc2-2ebf-44d6-9ea5-e40ea36f34df --logins <http://accounts.google.com|accounts.google.com>="googe_id_token"
    I ran this command and got this error
    Could not connect to the endpoint URL: "<https://cognito-identity.us-east1.amazonaws.com/>"
    How do i fix this?
    f
    • 2
    • 2
  • m

    Mischa Spiegelmock

    06/01/2022, 11:40 PM
    Still a blocker for me setting up my new project: https://serverless-stack.slack.com/archives/C01JG3B20RY/p1653769435652249
    d
    a
    +2
    • 5
    • 29
  • m

    Mischa Spiegelmock

    06/01/2022, 11:41 PM
    the
    SSTEdgeLambdaBucket
    resource just deploys forever until it times out hours later
    f
    • 2
    • 3
  • k

    Karmo Rosental

    06/01/2022, 11:54 PM
    Hi serverless people! 👋 I'm trying to add a lambda authorizer but I get
    {"message":"Unauthorized"}
    before authorizer is even run. I can't see what I am doing differently from the official example.
    Copy code
    authorizers: {
                lambda: {
                    type: "lambda",
                    responseTypes: ["simple"],
                    function: new Function(stack, "Authorizer", {
                        handler: `functions/authorizer.main`,
                    }),
                },
            },
    Copy code
    defaults: {
                authorizer: "lambda",
            },
    If I try to access protected endpoint then nothing at all is printed to terminal like it is for public endpoint. `functions/authorizer.ts`:
    Copy code
    export const main = async (event) => {
        console.log("Inside authorizer");
    };
    Where it can get blocked?
    o
    f
    • 3
    • 18
1...767778...83Latest