Adrián Mouly
06/07/2021, 10:01 AM/tasks
and service 2 uses /tasks/{id}/responses
…
Currently what I do is exporting the GW ID into CF from a parent SLS project and re-using that ID on the child projects (service 1 and 2).
How is this pattern supposed to be done on SST? Should I have 1 parent-stack and somehow reuse it from my 2 child projects?
I’m in the process of investigating what is needed to migrate my infrastructure from SLS to SST.Frank
sst start
prompts:
Press ENTER to redeploy infrastructure
Pressing ENTER doesn’t do anything as VSCode’s DEBUG CONSOLE
tab does not accept user input.
You should be able to get around this by setting "console": "integratedTerminal"
. Here’s the full launch.json. This will start the debugging console under the TERMINAL
tab in VSCode. And user input are accepted there.
^Let me know if there is a better way to accept input from the DEBUG CONSOLE
tab.Ross Coundon
06/11/2021, 10:38 AM{
"name": "some-name",
"stage": "local",
"region": "eu-west-2",
"lint": true,
"typeCheck": true
}
I have a file in the root of the application named .env.local
In the docs here it says that the app should load the env vars in that file because my stage is local.
However, this doesn't happen. If I console log process.env
inside my stack definition ts file, none of the vars are there. What am I missing?Sakar
06/11/2021, 12:47 PMOleksii
06/11/2021, 1:22 PMSakar
06/12/2021, 2:10 PMMike McCall
06/12/2021, 2:30 PMSakar
06/13/2021, 9:46 AMAdrián Mouly
06/14/2021, 6:13 AMSakar
06/14/2021, 10:14 AMAdrián Mouly
06/15/2021, 1:49 AMAdrián Mouly
06/15/2021, 2:15 AM/Users/.../tasksApi/lib/TasksApiStack.ts
0:0 error Parsing error: Cannot read file '/users/.../node_modules/@serverless-stack/cli/tsconfig.json'
/Users/.../tasksApi/lib/index.ts
0:0 error Parsing error: Cannot read file '/users/.../node_modules/@serverless-stack/cli/tsconfig.json'
Looks like is not able to find the tsconfig from the root node_modules?Adrián Mouly
06/15/2021, 3:20 AMcustom authorizer
, now I want to reference it from my SST stack, is there any example on how to do that?
const authorizer = new HttpLambdaAuthorizer({
authorizerName: "LambdaAuthorizer",
handler: new Function(this, "Authorizer", {
handler: "src/authorizer.main",
}),
});
Maybe I can specify the ARN somehow?Adrián Mouly
06/15/2021, 4:27 AMservices
- apiGateway -> defines root for /tasks + custom authorizer function -> this uses REST API
- tasksApi -> defines functions for /tasks + references API GW defined above from CF resources
- surveyApi -> defines functions for /tasks/{id}/surveys + references API GW defined above from CF resources
So my idea is to migrate these 3 projects into 3 separated SST projects / stacks.
services
- main -> defines MainStack -> contains the API root + Authorizer
- tasksApi -> defines TasksApiStack -> contains functions + references MainStack (how?)
- surveyApi -> defines SurveyApiStack -> contains functions + references MainStack (how?)
Is there any recommendation or best practices on how to do this? Should I use this structure of separated services, or should I move into 1 single SST project with many-stacks?Ryan
06/15/2021, 1:27 PMsst start
it builds the SPA each time and the whole process takes a while.
I have a few questions:
• Is there a way to sst start <stack>
? Usually I am working on the frontend locally and don't want to bother building it (which takes forever)
• Can the Static Site skip building if there are no changes to the source?
• Should I have the frontend / backend in separate Apps, rather than separate stacks? Then I can just manually start the backend one. (But also means I need to do multiple deployments and start scripting it and... it feels like a workaround)
• Is there a guide for how to structure a project and general guidelines of when to split stacks and apps? It seems quite different to serverless framework...Oleksii
06/16/2021, 1:19 PMError: The domain name needs to be in lowercase
I see that in version 0.17 a new check has been added to enforce the domain name format. But in our case, we are using the SSM parameter to construct the domain name, so the domainName
attribute has the value:
name.${Token[TOKEN.153]}
is there a workaround for this error?Sakar
06/16/2021, 2:55 PMthdxr
06/16/2021, 3:03 PMCould not find module root given file: \"internal/modules/cjs/loader.js\". Do you have a `package.json` file? "
Sakar
06/19/2021, 8:10 AMSakar
06/20/2021, 11:05 AMRoss Coundon
06/21/2021, 11:59 AMDrew
06/22/2021, 10:01 PMBrinsley
06/23/2021, 8:04 AMMichael Wolfenden
06/23/2021, 10:43 PMRupali Lande
06/25/2021, 9:44 AMthdxr
06/25/2021, 1:04 PMRoss Coundon
06/25/2021, 10:22 PMSakar
07/01/2021, 5:57 AMgio
07/01/2021, 8:31 AMthdxr
07/01/2021, 2:17 PM