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

    Albert Gao

    06/20/2021, 1:06 AM
    I might accidentally removed some component that SST replies on, like a VPC or ec2. How do I recreate this? 🤣
    f
    • 2
    • 11
  • t

    TrashyDev

    06/20/2021, 5:14 PM
    Hello guys, I have an error 403 does someone know how I can fix it? And my new note component wont show up?
    r
    • 2
    • 37
  • a

    Albert Gao

    06/21/2021, 8:23 AM
    Hi, guys. How to enable a lambda to access an Aurora Serverless? I got the secrets through the SecretManager, and aurora/lambda sits in one VPC, and still get error from the ORM library: Can’t reach database server at `blahblah.rds.amazonaws.com`:`5432` Please make sure your database server is running at `blahblah.rds.amazonaws.com`:`5432`Ā (edited)
    f
    • 2
    • 9
  • l

    Luca Demmel

    06/21/2021, 9:57 AM
    Hey šŸ™‚ We’re struggling with external modules in local development. We’re seeing ā€œCould not resolve ā€œclass-transformerā€ (mark it as external to exclude it from the bundle)ā€ errors on the ā€œStarting lambda codeā€¦ā€ step. We’ve listed those externals in the bundle prop of the functions already. Any ideas/tips?
    a
    r
    f
    • 4
    • 4
  • t

    TrashyDev

    06/21/2021, 1:55 PM
    hey guys, I'm trying to communicate with the backend from the client (in the serverless stack tutorial) but i get a 502 error saying
    Copy code
    {
      "message": "Missing Authentication Token"
    }
    a
    r
    j
    • 4
    • 33
  • t

    thdxr

    06/21/2021, 6:37 PM
    Does anyone use terraform alongside CDK? I'm thinking about how best to organize everything. I've been using terraform to provision global resources (vpc, multiple aws accounts per env, etc) but wondering if I should just do everything in cdk
    r
    • 2
    • 13
  • o

    Omi Chowdhury

    06/22/2021, 2:43 AM
    So what are folks doing for data migrations (e.g. schema changes) - esp if you’re running multiple DBs? Avoid them by writing backward compatible code? Write migration scripts? I ended up using the same tooling as the rest of the app (lambda, sqs, common libs etc) to build a stack that executes the migration. The process gets kicked off via the AWS lambda console, and once it finished I removed the associated resources from AWS.
    t
    f
    a
    • 4
    • 34
  • b

    Brinsley

    06/22/2021, 6:50 AM
    Hey guys, I’m hoping someone can help me with an issue I’ve been having. I’ve been evaluating SST as possible avenue to simultaneously move away from Terraform and the faff with Serverless yaml files- managed to get everything running and deploying to a personal test environment no problem. As soon as I try to deploy to a different env. (UAT in this case) I get an error:
    Copy code
    uat-service-stack failed: The uat-service-stack stack failed to deploy.
    Looking further up the logs I see this:
    Copy code
    Deploying stacks
    uat-service-stack: deploying...
    [0%] start: Publishing _sha_:current
    [16%] fail: No bucket named 'cdk-blah-assets-ACCOUNT-REGION'. Is account ACCOUNT bootstrapped?
    ...
    I’ve been trying to fix and Google around this problem for around three days and I’m just dead in the water. From what I’ve read, using
    sst deploy
    should take care of the CDK bootstrapping right? What am I missing here?
    f
    • 2
    • 8
  • t

    Tomasz Michalak

    06/22/2021, 8:02 AM
    Hi, I am trying to set up a cache policy for CloudFront. The cache policy requires having a unique name, so I need to ā€œdecorateā€ it with a stage name. So I try to use:
    Copy code
    cachePolicyName: scope.stageName + 'CFrontCachePolicy'
    where scope is
    <http://sst.App|sst.App>
    . The problem is that
    stageName
    is empty. What is the reason for that?
    f
    • 2
    • 8
  • k

    Karo

    06/22/2021, 7:59 PM
    Hi šŸ‘‹ , I’m in the process of moving to a new laptop. I’m running into an error related to the CDK toolkit bucket. Initially it complains that is inaccessible, however, I do have access to that bucket (it works from the AWS console or while using cli with the same credentials/token). Region configuration is fine as well. I can deploy with no issues from my old laptop. CDK is bootstrapped to the correct account.
    Copy code
    [0%] start: Publishing 56390565ccdc759b266225bf9130ac51078bc677d20185a4d279888b294a2688:xxx-us-east-1
    [50%] success: Published 56390565ccdc759b266225bf9130ac51078bc677d20185a4d279888b294a2688:xxx-us-east-1
    [50%] start: Publishing 3035421a19ebfd74d42640670926ecc263446e6891f9bcb59cc9b6fe93d961d7:xxx-us-east-1
    
    [100%] fail: Inaccessible host: `<http://cdk-hnb659fds-assets-xxx-us-east-1.s3.amazonaws.com|cdk-hnb659fds-assets-xxx-us-east-1.s3.amazonaws.com>'. This service may not be available in the `us-east-1' region.
    After the first run, this is the error I get when retrying:
    Copy code
    [0%] start: Publishing c3a93133082f6ad1e61e99d22b86c5a4b6293e977bb569f297395cafa327b509:xxx-us-east-1
    [33%] success: Published c3a93133082f6ad1e61e99d22b86c5a4b6293e977bb569f297395cafa327b509:xxx-us-east-1
    [33%] start: Publishing 67b7823b74bc135986aa72f889d6a8da058d0c4a20cbc2dfc6f78995fdd2fc24:xxx-us-east-1
    [66%] success: Published 67b7823b74bc135986aa72f889d6a8da058d0c4a20cbc2dfc6f78995fdd2fc24:xxx-us-east-1
    [66%] start: Publishing d887caad65f1d4216fbfd254545dee7bb6d8a71ea2efe1834675512e73b8acb6:xxx-us-east-1
    [100%] fail: socket hang up
    Any ideas? Has anybody seen that one before?
    f
    • 2
    • 8
  • m

    Mr.9715

    06/22/2021, 8:33 PM
    Hey Guys any idea on how can we put some initial data in dynamodb during CDK deployment? It will be so much better if we can update/reset data in db when let say DB construct is updated.. etc. (don't want to run this script on every deployment if there is no change to db or the data) using aws cli for now using dynamodb update query.
    t
    f
    • 3
    • 10
  • b

    Brett Gullan

    06/23/2021, 2:18 AM
    Hi There, I’ve been getting my head around SST for the past few days, and really impressed with the setup so far. I’ve run into one problem that I can’t seem to get past … I need to connect my API/Lambda functions to an RDS MySQL instance (in an Isolated Subnet). I’ve configured an SST API stack to do this, with the Lambda function associated with a VPC, SGs, etc. And I have it working when deployed. However, as soon as I add the Lambda function to my VPC, my Live Lambda Development environment stops working. It seems that the API GW fails to find/reach the debug Lambda? I get absolutely no output in the console, and the API request just times out. Any suggestions would be really appreciated!
    t
    f
    • 3
    • 18
  • s

    Simon Reilly

    06/23/2021, 9:27 AM
    Hey everyone, can we serve static files from s3 using the sst.Api construct? Been looking around the aws-cdk for any s3 proxy integrations aswell and haven't found any šŸ˜•
    f
    • 2
    • 3
  • t

    Tomasz Michalak

    06/23/2021, 1:01 PM
    Hi, is there any documentation how to enable X-Ray tracing for the API construct?
    f
    • 2
    • 3
  • n

    Nick Laffey

    06/25/2021, 8:05 PM
    The error message suggests marking the package as external but I’m not sure if I can do that as sst has abstracted away esbuild
    t
    • 2
    • 5
  • t

    Tony J

    06/28/2021, 1:57 AM
    I know that there was some discussion about this earlier, but I couldn't figure out the exact thing to do. When running the same "stack" that is already deployed (because I want to run it locally and test changes before deploying again) I use sst start. But it seems like if I use sst start, and then when I'm done use close my laptop. It will cause the version that was deployed (using sst deploy) to fail?
    f
    • 2
    • 2
  • d

    Drew

    06/28/2021, 8:19 PM
    Anyone else using CDK w/ Secrets Manager + RDS + Lambda? We just clicked the "rotate secret" button, and discovered that our Lambdas did not see the new secret. I'm stunned. We redeployed and it still didn't update. Today, we use environment variables to give the secrets to our lambas. Does anyone use the AWS SDK to directly fetch secrets from Secrets manager?
    f
    t
    +3
    • 6
    • 33
  • b

    Brett Gullan

    06/29/2021, 4:02 AM
    This may be little off-topic, but does anybody have any experience with or examples of how to do blue/green API deployments?
    n
    • 2
    • 1
  • t

    Tony J

    06/29/2021, 10:47 PM
    Hi everyone, I'm trying to schedule a schedule trigger for a sst Function and the docs seem to lead me hereĀ https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.IEventSource.htmlĀ which provide limited visibility into the actual sst syntax. Does anyone have any experience doing this previously? Thanks
    f
    • 2
    • 1
  • s

    Sam Frampton

    06/30/2021, 11:59 AM
    Hey, I’m trying out the
    sst start
    to develop lambda locally. I run the command and I get the response
    Unknown script "start".
    r
    • 2
    • 11
  • a

    Ashishkumar Pandey

    06/30/2021, 1:44 PM
    How can I use customDomains for the Api Construct conditionally, such as on the basis of
    stageName
    ?
    f
    • 2
    • 7
  • a

    Andrew Blaney

    07/01/2021, 1:49 PM
    Hi! I'm trying to add a secondary global index to a
    sst.Table
    that already exists, with 1 existing secondary index. I've tried adding it to
    TableProps.secondaryIndexes
    property of the table, and also tried using
    table.dynamodbTable.addGlobalSecondaryIndex()
    but when I deploy, no changes are found for the stack.. any ideas? thanks!
    f
    • 2
    • 11
  • a

    Alfred Brose

    07/01/2021, 3:10 PM
    Hello fellow developers, I'm working my wy through the notes app example on serverless-stack.com and for some reason I'm not able to test the users authentication (https://serverless-stack.com/chapters/test-the-apis.html). I'm always getting a 500. I've added some logging output and could narrow the problem down - apparently the event.requestContext.identity object is not populated, the key cognitoIdentityId is null. I double checked every step in the tutorial so far and now I'm out of ideas. Can anyone point me into the right direction?
    f
    j
    • 3
    • 10
  • s

    Sam Frampton

    07/01/2021, 5:43 PM
    Hey, I’ve been struggling with integration testing dynamodb tables inside my lambdas. Can anyone link tutorial or some kind of documentation on best practice to test dynamodb locally in serverless apps? So far my search has found • Installing Java and trying to run dynamodb locally which Ideally prefer to find a quicker and simpler method • Loading variables into dynamodb config when process.env.IS_OFFLINE. I’m interested to know how people test dynamodb, any suggestions?
    r
    j
    • 3
    • 17
  • g

    Guy Shechter

    07/01/2021, 9:41 PM
    Hi, has anyone been able to publish an API/Lambda that depends on a private Python module? My module is published in AWS CodeArtifact, but during the Docker-based build process, it’s looking in public module repositories and fails
    Copy code
    #13 [9/9] RUN if [ -f 'requirements.txt' ]; then pip install -r requirements.txt -t .; else echo "requirements.txt not found"; fi
    #13 0.723 ERROR: Could not find a version that satisfies the requirement myprivatemodule (from versions: none)
    #13 0.723 ERROR: No matching distribution found for myprivatemodule
    #13 ERROR: executor failed running [/bin/sh -c if [ -f 'requirements.txt' ]; then pip install -r requirements.txt -t .; else echo "requirements.txt not found"; fi]: exit code: 1
    ------
     > [9/9] RUN if [ -f 'requirements.txt' ]; then pip install -r requirements.txt -t .; else echo "requirements.txt not found"; fi:
    ------
    executor failed running [/bin/sh -c if [ -f 'requirements.txt' ]; then pip install -r requirements.txt -t .; else echo "requirements.txt not found"; fi]: exit code: 1
    
    Error: docker exited with status 1
        at dockerExec (/src/myapp/node_modules/@aws-cdk/core/lib/bundling.ts:450:11)
        at Function.fromBuild (/src/myapp/node_modules/@aws-cdk/core/lib/bundling.ts:266:5)
        at Function.fromAsset (/src/myapp/node_modules/@aws-cdk/core/lib/bundling.ts:156:24)
        at Object.bundle (/src/myapp/node_modules/@serverless-stack/resources/src/util/python/bundling.ts:107:41)
        at Object.builder (/src/myapp/node_modules/@serverless-stack/resources/src/util/pythonBuilder.ts:42:15)
        at new Function (/src/myapp/node_modules/@serverless-stack/resources/src/Function.ts:245:21)
        at Function.fromDefinition (/src/myapp/node_modules/@serverless-stack/resources/src/Function.ts:326:14)
        at Api.addRoute (/src/myapp/node_modules/@serverless-stack/resources/src/Api.ts:339:23)
        at /src/myapp/node_modules/@serverless-stack/resources/src/Api.ts:198:14
        at Array.forEach (<anonymous>)
    
    There was an error synthesizing your app.
    FWIW, when building my own docker containers I use the following script with environment AWS_* credentials to pull dependencies defined in
    requirements.txt
    from both AWS CodeArtifact and PyPi.org
    Copy code
    #!/bin/sh
    CODEARTIFACT_AUTH_TOKEN=`/usr/local/bin/aws codeartifact get-authorization-token --domain mydomain --domain-owner 1111111111 --query authorizationToken --output text`
    pip3 install -v d  \
      --index-url "<https://aws>:$CODEARTIFACT_AUTH_TOKEN@mydomain-1111111111.d.codeartifact.us-east-1.amazonaws.com/pypi/myprivatemodule/simple/" \
      --extra-index-url "<https://pypi.org/simple>" "myprivatemodule>=0.0.16"
    One workaround would be to publish a lambda Layer of my private module, but I’m not sure that solution would work for local debugging.
    f
    • 2
    • 25
  • b

    Branko Gvoka

    07/02/2021, 10:02 AM
    Should SST pick up automatically .env file and load them into process.env? https://docs.serverless-stack.com/environment-variables I’ve added .env file but seems like process.env is empty. Am I doing something wrong? Should I include dotenv and dotenv.config() in the beginning of the app? šŸ™‚ I’m using v0.30
    g
    j
    f
    • 4
    • 5
  • t

    Tobias Otte

    07/04/2021, 10:03 PM
    I’m creating the edge function via
    Copy code
    const edgeFunc = new experimental.EdgeFunction(this, "WebsiteEdge", {
          runtime: Runtime.NODEJS_12_X,
          handler: "test.handler",
          code: Code.fromAsset("src/test"),
          stackId: `${scope.logicalPrefixedName("edge-lambda")}`,
        });
    f
    • 2
    • 17
  • b

    Brett Gullan

    07/05/2021, 12:58 AM
    Getting a weird error that I'm not sure how to debug … Seemingly all of a sudden, when I try to
    deploy
    an SST API Stack, I'm getting a reported linting error. I can't figure out why it's happening. Have tried rolling back to earlier commits, but still getting the same error. Any pointers greatly appreciated šŸ˜… SST debug log attached, if that helps! BTW, everything works fine if I run locally, using
    npx sst start
    f
    • 2
    • 42
  • p

    Patrick Young

    07/05/2021, 1:33 AM
    Hey! Absolutely love SST! It has made me almost move all my firebase side projects over to AWS 😱 . Currently my team has the opportunity to green field a project... so I picked all new technology because paying me to learn! We started with aws amplify and after grinding for 6 weeks on it we removed it for SST and CDK and man... took like 2 days to replicate everything šŸ˜† . Again... awesome work. We would like to use Aurora with TypeORM and have it "working" but obviously there are limitations with esbuild (also another project that made my jaw drop). I believe there is a discussions for SST to include plugins so we can support emitDecoratorMetadata but I'm worried about gotchas there. So my question is... what are other people using for this layer? Specifically the entity manager layer which helps with consistency of updatedAt / createdAt / validation / migrations / etc. I usually just write my own but... you know bugs šŸ™‚... and documentation šŸ™‚... I find it fun though...
    f
    b
    +3
    • 6
    • 14
  • m

    Michael Wolfenden

    07/05/2021, 2:19 AM
    Is there anyway to access the stage created by the
    api
    construct so I can set these
    AWS::ApiGatewayV2::Stage RouteSettings
    properties
    Copy code
    {
      "DetailedMetricsEnabled" : Boolean,
      "ThrottlingBurstLimit" : Integer,
      "ThrottlingRateLimit" : Double
    }
    f
    • 2
    • 5
1...789...83Latest