Sean Matheson
02/22/2022, 3:24 PMonCreate
/ onUpdate
/ onDelete
in the context of the sst.Script
. I am looking to run DB migrations on each deploy. Do I have to mount the lambda against the onCreate
and onUpdate
properties? It is a bit confusing as the docs state that "It gets run on every deployment."Sam
02/22/2022, 5:50 PMUnhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"ReferenceError: require is not defined","reason":"ReferenceError: require is not defined","promise":{},"stack":["Runtime.UnhandledPromiseRejection: ReferenceError: require is not defined"," at process.<anonymous> (file:///home/sam/Desktop/wrs/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)"," at process.emit (node:events:394:28)"," at emit (node:internal/process/promises:136:22)"," at processPromiseRejections (node:internal/process/promises:242:25)"," at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Ernie Francis
02/22/2022, 7:14 PMErnie Francis
02/22/2022, 8:37 PMauth.attachPermissionsForAuthUsers([api]);
when creating the sst.Auth() constructor. but what if i want to reference an existing already provisioned cognito userpool?Kujtim Hoxha
02/22/2022, 10:43 PM*filterPatterns*
on a kineses stream? I think addConsumer
does not support that but looking at an example in SLS
it looks like it should be possible.Devin
02/23/2022, 12:33 AMGenerally you should specify paths relative to SST.json
---
This might seem obvious but it isn’t to me so if someone knows, I’d appreciate it.
I have the following directory structure:
src/
lambda-handler/
rewiter.js
stacks/
SiteStatck.js
index.js
sst.json
Inside StaticSite
, I’d like to attach an edge lambda function. That looks vaguely like this:
const originRewriteHandler = new experimental.EdgeFunction(
this,
"OriginRewriteFunc",
{
runtime: lambda.Runtime.NODEJS_14_X,
handler: "src/lambda-handler/rewriter.main",
// this path is wrong and I can't figure it out
code: lambda.Code.fromAsset(path.join(__dirname, "lambda-handler")), <----------------------
}
);
Everywhere I go with different paths I end up in .build
Bshr Ramadan
02/23/2022, 1:04 AMsst deploy [stack]
it builds the whole functions and web components for all stacks.
How can I just build the constructs related to the specific stack only?Brinsley
02/23/2022, 11:16 AMScript
construct with VPC resources. Having ongoing woes with a post-deploy migrations script and have hit another wall:
getaddrinfo ENOTFOUND {rds address}
Any ideas? Thought it might be a permissions thing so I added a PolicyStatement
to go allow all actions on the arn for the VPC and RDS instance. I’m stuck.Noah D
02/23/2022, 11:43 AMdown
part of a migration using the new sst RDS construct? Can run up
easily through sst console, but doesn't seem to be an easy way to clear changes if for example I need to change something while in developmentRobin
02/23/2022, 1:32 PMArtem Pabacham
02/23/2022, 2:28 PMSean Matheson
02/23/2022, 3:07 PMsst diff
into a variable within bash, but it appears the actual CDK diff is output via an inner child process or something. I end up getting something like this:
❯ body=$(./node_modules/.bin/sst diff --stage dev)
Stack dev-foo
IAM Statement Changes
... actual CDK DIFF
And outputting body variable:
❯ echo "$body"
Using stage: dev
Preparing your SST app
Building function src/foo/bar.handler
...
Anyone tried anything similar? I almost have a GitHub action working here. Just need to be able to nab the correct output. 😄Bshr Ramadan
02/23/2022, 5:09 PMsst start
so it will take about 1.5 hour to deploy.
Actually when running deploy from local machine, it take much fewer time to deploy, I think because there is some caching process in sst
I found that there is a caching option for github actions here:
https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action
So I want to ask what files and folders should I cache, is .sst
folder enough?Brinsley
02/23/2022, 7:03 PMAustin
02/23/2022, 7:17 PMErnie Francis
02/24/2022, 1:52 AMDan Beaven
02/24/2022, 2:49 PMNeed to perform AWS calls for account my-account, but no credentials have been configured
Found errors
Pavan Kumar
02/24/2022, 3:21 PMErnie Francis
02/24/2022, 3:50 PMErnie Francis
02/24/2022, 7:28 PMPablo Fernandez
02/24/2022, 7:58 PMRoss Gerbasi
02/24/2022, 9:11 PMJ. T. Garcia
02/24/2022, 9:24 PMEnvironmentCredentialsProviderFailure: Variable AMAZON_ACCESS_KEY_ID not set.
I'm only seeing it in the ci pipeline, where I've only set AWS_ACCESS_KEY
and AWS_SECRET_KEY
Drew
02/25/2022, 12:32 AMErnie Francis
02/25/2022, 1:01 AMMuhammed Mukhthar CM
02/25/2022, 11:58 AMHenry Villavicencio
02/25/2022, 12:20 PMJohn
02/25/2022, 8:33 PMdata-api-client
npm package to handle the requests and connection to the DB. I'm getting some timeouts when using this - Failed to send response because the Lambda function is disconnected
I'm wondering can I use the AWS SDK RDS Data Client package instead - https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds-data/index.html#aws-sdkclient-rds-data?Patrick
02/25/2022, 11:04 PMsst.StackSite
construct?
I’m trying to deploy my CDK app with Seed, but I get an error when building the site because the node_modules for building the site are nested in another folder, and the build pipeline is trying to find it the project root
├── sst.json
├── node_modules // <- my SST dependencies
├── package.json
├── stacks
│ ├── index.tx // <- creates stack for deploying static site in /apps/static-site
├── apps
│ ├── static-site
│ | ├── package.json
│ | ├── node_modules // <- my React dependencies
The error I’m getting is react-scripts:not found
(it’s installed in the static-site
folder, not the project root) (edited)Tony J
02/25/2022, 11:38 PM