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

    Joel Corona

    11/18/2021, 12:29 PM
    that is, if it detects that it already exists, use it, otherwise create it.
    t
    j
    • 3
    • 6
  • l

    Lukasz K

    11/18/2021, 5:19 PM
    Has anyone here done sort of a A/B testing for ApiGwV2 -> Lambda routes? I know gwV1 can do this in the form of canary deploys (kinda) but V2 is limited in options and so far I don't have any ideas for an easy workarounds. My planned usecase is to run A/B with different configurations on real workloads but maybe I'm better off running Lambda Power Tuning once...
    d
    s
    • 3
    • 5
  • c

    Clayton

    11/18/2021, 8:55 PM
    @thdxr I wonder if it may be helpful to omit this rule in the TypeScript boilerplate
    .gitignore
    – https://github.com/serverless-stack/serverless-stack/blob/master/packages/create-serverless-stack/templates/typescript/.template.gitignore#L13 I had a project with a mix of JS and TS files (in the process of learning TS) and didn’t realize until a bit later that a number of files weren’t being committed to version control.
    d
    • 2
    • 3
  • g

    Gerald

    11/19/2021, 1:11 AM
    Do ApolloApi custom domains also automatically create an A Record?
    f
    • 2
    • 10
  • g

    gio

    11/19/2021, 9:18 AM
    I’m using StaticSite for one Angular app, I used replaceValues property to fill all environment variables (userpool id, api endpoint, regions, and much more). When I run
    npx sst deploy
    everything works great but when I run
    npx sst start
    app is unreachable (it show me the sst page which say to run static site locally). So I run
    npx ng serve
    to run angular locally, but. it doesn’t work because all environment variables are not filled to properly values. All environment variables in angular are defined in two file (one for prod) which is called environments.ts:
    export const environment = {
    production: false,
    API_BASE_PATH:                '{{ API_DOMAIN }}',
    IDENTITY_POOL_ID:             '{{ IDENTITY_POOL_ID }}',
    IDENTITY_POOL_REGION:         '{{ IDENTITY_POOL_REGION }}',
    USER_POOL_ID:                 '{{ USER_POOL_ID }}',
    USER_POOL_WEB_CLIENT_ID:      '{{ USER_POOL_WEB_CLIENT_ID }}',
    USER_POOL_REGION:             '{{ USER_POOL_REGION }}',
    BUCKET_NAME:                  '{{ BUCKET_NAME }}',
    BUCKET_REGION:                '{{ BUCKET_REGION }}'
    };
    I have two question: 1. Which is the way to run properly an angular app? 2. Why SST doesn’t implement a short way (included in sst start) to serve a local site (maybe specifying external tool command)?
    t
    r
    f
    • 4
    • 8
  • r

    Ryan

    11/19/2021, 12:05 PM
    Hey super heroes! I want to write some of the stack outputs to a local JSON file (Similar to how the
    StaticSite.environment
    field writes to the
    static-site-environment-output-values.json
    ) How would I do that? My specific use case is that I'm setting up DynamoDB Onetable, and I want to put the table name and function ARN into a config file for it so I don't need to manually grab them and paste.
    r
    g
    +3
    • 6
    • 16
  • m

    manitej

    11/19/2021, 1:54 PM
    How do you load env variables at runtime in angular?
    r
    g
    f
    • 4
    • 13
  • r

    Ryan

    11/19/2021, 2:11 PM
    What's the best way to debug a
    sst.Script
    ? Should I temporarily convert it to a
    sst.Function
    and then call it manually?
    b
    f
    • 3
    • 5
  • b

    Blake E

    11/19/2021, 4:55 PM
    So I just saw someone on my team (yes, I’ve started getting SST into our eng department 😄 very stoked) but we upgraded and got access to
    sst start --console
    web-console - SO very cool! 🚀 🏆 Anyone have any links that can point me to learn more about this? vision behind this, ability to extend for our use-cases? We’re seeing this as a very useful lil addition and are excited to see more 😄
    f
    • 2
    • 5
  • r

    Ross Coundon

    11/19/2021, 10:44 PM
    If I want to include aws-sdk in my bundle to be sure of the version, is it a case of specifying
    externalModules
    in the bundle and omitting aws-sdk?
    f
    • 2
    • 3
  • h

    Hamed Mamdoohi

    11/20/2021, 11:56 PM
    Not sure if you have seen this before https://marketplace.visualstudio.com/items?itemName=devAdvice.serverlessconsole But it's a pretty cool extension that allows looking at DynamoDB tables and cloudwatch logs. It would be cool if we can explore table rows within SST Console now that local lambda logs are available
    f
    c
    • 3
    • 9
  • g

    Gerald

    11/21/2021, 3:49 AM
    does anyone already tried ApolloApi? does subscription works? planning to use it.
    f
    r
    • 3
    • 2
  • m

    Mikko Mannonen

    11/21/2021, 10:55 AM
    Whats the roadmap for Next.js 12 support? And do you plan to allow "Vercel way" to do deployments. Meaning that all page/api endpoints run on normal lambda and middleware on lambda@edge? SST uses @sls-next/lambda-at-edge library and developer who continues to maintain that repo is also developing pure lambda deployment library. So by using that SST can probably adopt next.js lambda deployment. Although schedule is little bit worrisome as there is only one busy developer of that library and "help wanted" ticket has been open since march.
    f
    • 2
    • 5
  • g

    Gerald

    11/21/2021, 11:37 AM
    How do you create child resolvers in AppSyncApi?
    f
    • 2
    • 3
  • g

    Gerald

    11/21/2021, 12:25 PM
    what is the compatible version of apollo-server-lambda need to use in sst? playground property is missing in ApolloServer
    r
    • 2
    • 2
  • a

    Adrián Mouly

    11/22/2021, 12:49 AM
    Hey guys, I’m creating a new PY project living together with my other TS/JS lambdas… But during compile I’m getting this error:
    Copy code
    Bundling dependencies for backend/src/pythonTest in Docker...
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
    Not sure why is requiring to run on Docker? This is the definition in my stack:
    Copy code
    new Function(this, 'MyPythonTestLambda', {
          srcPath: 'backend/src/pythonTest',
          handler: 'index.main',
          runtime: 'python3.7',
        });
    f
    • 2
    • 3
  • r

    Ryan

    11/22/2021, 12:01 PM
    Hi again super heroes! Having a bit of trouble working out how to get the cognito user pool oauth redirect URLs from the frontend, when the cognito user pool itself is passed into the frontend (so it knows where to redirect users). Bit of a chicken and egg scenario. I'm using the Cognito hosted UI eg. (A few bits missing here, but it explains the core pieces)
    Copy code
    // cognito stack
            const userPoolClient = userPool.addClient('app-client', {
                oAuth: {
                    callbackUrls: [frontendStack.url], // Can't inject this here because the static site isn't made yet
                    logoutUrls: [frontendStack.url],
                }
            });
    
            const userPoolInstance = new sst.Auth(this, "Auth", {
                cognito: {
                    userPool,
                    userPoolClient,
                },
            });
    Copy code
    // frontend stack
            const frontendSite = new sst.StaticSite(this, "frontend", {
               environment: {
                  "COGNITO_LOGIN": cognitoStack.url  // Need this in the constructor
               }
            }
    I have to set those properties in the constructors. There isn't any way to add them afterwards as far as I can see. Surely there is a way to get this working? I can manually construct the user pool domain and pass that around rather than the pool itself, but I kind of like everything being auto-generated so I know it's always correct. But would that be the best solution? Maybe I could defer the creation of the Auth construct until the front-end is made, but then the backend stack (which depends on it) will come after the front-end... And I'm sure that is going to cause issues? It feels like I should be able to set those redirect URLs (callback URLs) after the front-end, but I can't see how.
    t
    t
    • 3
    • 15
  • a

    Adrián Mouly

    11/23/2021, 12:27 AM
    I mean, I got used to build “everything” into docker, mostly my NestJS APIs (not serverless related).
    t
    • 2
    • 4
  • a

    Adrián Mouly

    11/23/2021, 3:13 AM
    Getting this issue on my brand new Python function on SST deploy:
    Copy code
    03:08:26 | CREATE_FAILED        | AWS::Lambda::Function      | MyPythonTestLambda94F3A946 - Resource handler returned message: "Unzipped size must be smaller than 261144790 bytes (Service: Lambda, Status Code: 400, Request ID: 89566dbb-2ba6-4517-b4ee-79fc61a3be73, Extended Request ID: null)" (RequestToken: 593fa1dc-a52d-6714-60a1-76a5e14c23ff, HandlerErrorCode: InvalidRequest)
    m
    f
    • 3
    • 5
  • r

    Ryan

    11/23/2021, 5:08 AM
    So my ultimate wish for
    sst.Script
    to help develop and debug scripts! (It's almost like a "deployment breakpoint") I found for simple cases, converting to a function is just fine. But for more complex cases, where you need the script to succeed for the rest of the deployment to work, then you get very stuck and resort to commenting out a lot of code everywhere to get the environment in a place where you can use the awesomeness of live lambda development. I'd love to be able to set a flag on a script that does the following on `sst start`: • The function is deployed in live mode • On deployment, when the script would normally be executed (by create or update), the deployment halts there! (Breakpoint) • In "interactive mode", the function becomes live for local development immediately. You can invoke the lambda, change the code, do whatever you like (just like function live development) • It gives you helpers, eg. print out an AWS CLI command to invoke the lambda the same way that it would be by cloud formation. Or some kind of console. So by default you can just execute it exactly as it normally would be done with the same params as in the stack code. • You can at any point continue with deployment or rollback, (marking it as success or failed), and cloud formation continues appropriately It would make working with scripts an absolute delight 🙂
    s
    s
    f
    • 4
    • 10
  • s

    Sean Matheson

    11/23/2021, 12:47 PM
    I see https://remix.run/ launched. Would be epic to get in there early games with a construct.
    t
    c
    +5
    • 8
    • 34
  • c

    Clayton

    11/23/2021, 10:36 PM
    I’m trying to better understand how to work with DyanmoDB. One thing that’s confusing is the use of
    primaryIndex
    in SST’s Table construct. Is this value a 1:1 with the Primary Key concept from DDB’s documentation - or does it encapsulate something more? And, if it is the same, is the reason for the different name in SST to normalize it with ‘Secondary Index’ or something else?
    t
    d
    +5
    • 8
    • 36
  • r

    Ross Coundon

    11/24/2021, 2:41 PM
    I'm defining an SQS queue and looking to set the Redrive Policy but can't find it as an option on the Queue construct or as a member of the sqsQueue property. However, if I import the CDK CfnQueue type directly, it's there. Am I right in thinking the
    Queue.sqsQueue
    property should expose the same properties as are available when doing
    new CfnQueue() ?
    t
    • 2
    • 9
  • s

    Sean Matheson

    11/24/2021, 3:03 PM
    Am I correct in assuming that the Next.js construct creates a single Lambda @ Edge function for all SSR pages?
    d
    f
    • 3
    • 3
  • m

    Michael Orcutt

    11/24/2021, 7:50 PM
    Considering Lambda and API Gateway are down in
    us-east-2
    , are there any docs/sst support for multi-az?
    t
    d
    +2
    • 5
    • 8
  • a

    Adrián Mouly

    11/25/2021, 1:59 AM
    Is somebody using Lambda in Docker? I’ve never heard about this, but now my Python developer deployed some stuff following this tutorial: https://aws.amazon.com/es/blogs/compute/hosting-hugging-face-models-on-aws-lambda/
    s
    f
    • 3
    • 18
  • p

    Phil Astle

    11/25/2021, 6:45 PM
    Hi all. I've just started getting this error back when trying to deploy/redeploy my scripts:
    Copy code
    phil-debug-dentr-sst-after-deploy | UPDATE_FAILED | Custom::SSTScript | PostDeploymentScriptResourceE4FC8D7B Response object is too long
    Any help much appreciated!
    f
    • 2
    • 24
  • m

    Mitchell Mohorovich

    11/26/2021, 1:25 AM
    Hey! I had a had a question about packaging up a Python function. It tries to install a local repository, but it’s having issues during the Docker installation step. The example
    srcPath
    is a follows:
    Copy code
    handler.py
    private-repo
    poetry.lock
    pyproject.toml
    Where
    poetry.lock
    and
    pyproject.toml
    install
    private-repo
    directly. The issue I’m having is with this line: ([GitHub link](https://github.com/serverless-stack/serverless-stack/blob/2328bf3a5f938c9c448d9af5[…]8edded/packages/resources/assets/python/Dockerfile.dependencies))
    Copy code
    COPY Pipfile* pyproject* poetry* requirements.tx[t] ./
    Where only a small set of files are copied to
    /var/dependencies
    . This causes the error below because custom directories aren’t copied over.
    Copy code
    #12 [8/9] RUN if [ -f 'poetry.lock' ]; then poetry export --with-credentials --format requirements.txt --output requirements.txt; else echo "poetry.lock not found"; fi
    #12 sha256:729124a64255fd9df11c3256c2f02b195d0f5f7e798150b1579970bce9eccd3b
    #12 0.402 
    #12 0.402   ValueError
    #12 0.402 
    #12 0.402   Directory private-repo does not exist
    The question I had was 1. if there’s any way to customize this Dockerfile so I can also specify to copy over
    private-repo
    so the dependencies are installed properly? 🤔 Thanks a lot in advance!
    f
    • 2
    • 2
  • a

    Adrián Mouly

    11/26/2021, 4:44 AM
    I want to connect my newly created
    DockerImageFunction
    to an existing API GW v2 created with
    Api
    construct. Can I use the existing
    addRoutes
    method from
    Api
    or I have to level down to the CDK gw-integration construct? I did the integration this way:
    Copy code
    myApi.httpApi.addRoutes({
          path: '/books',
          methods: [HttpMethod.GET],
          integration: new LambdaProxyIntegration({
            handler: lambda,
          }),
        });
    But maybe there is a cleaner way?
    g
    f
    • 3
    • 5
  • a

    Adrián Mouly

    11/28/2021, 10:38 PM
    Question about HTTP API. If I’m using “custom domain” could I disable the “execute api” endpoint?
    Copy code
    httpApi: {
            disableExecuteApiEndpoint: true,
          },
    I mean, I’m never going to use it from my client apps.
    t
    • 2
    • 10
1...202122...33Latest